Product Design, Manufacturing & Innovation Resources
» 3단계 컴파일러 구조

3단계 컴파일러 구조

1980
Programmer working on three-stage compiler structure in a software development office.

(설명을 위한 생성된 이미지입니다)

최신 컴파일러는 일반적으로 프런트엔드, 미들엔드, 백엔드의 세 단계로 구성됩니다. 프런트엔드는 소스 코드를 분석하고 정확성을 검사한 후 중간 표현(IR)을 생성합니다. 미들엔드는 이 IR에 최적화 작업을 수행합니다. 마지막으로 백엔드는 최적화된 IR을 특정 CPU 아키텍처에 맞는 대상 기계어로 변환합니다.

This modular three-stage design provides a crucial separation of concerns. The front end is language-dependent but machine-independent; it understands the syntax and semantics of a specific language like C++ or Rust. Its output, the Intermediate Representation (IR), is an abstract, machine-agnostic data structure like an Abstract Syntax Tree (AST) or Three-Address Code. This decouples the source language from the target machine.

The middle end is largely language- and machine-independent. It takes the IR and applies a series of optimization passes, such as dead code elimination, constant folding, and loop optimizations. Because it operates on the generic IR, these complex optimizations can be written once and applied to any language that can be compiled to that IR.

Finally, the back end is machine-dependent but language-independent. It takes the optimized IR and performs instruction selection, register allocation, and instruction scheduling to generate efficient machine code for a specific target architecture, like x86-64 or ARM. This structure makes it possible to build compilers that support M languages and N targets by writing M front ends and N back ends, rather than M*N individual compilers. This principle is exemplified by modern compiler infrastructures like GCC and LLVM.

UNESCO Nomenclature: 1203
컴퓨터 과학

유형

추상 시스템

분열

기초적인

용법

널리 사용됨

전구체

  • early monolithic compiler designs
  • concept of abstraction in software engineering
  • development of intermediate languages in early systems
  • research into portable software (e.g., the p-code system)

응용 프로그램

  • retargetable compilers (e.g., GCC, llvm)
  • cross-compilation for different hardware platforms
  • language-agnostic optimization frameworks
  • development of new programming languages by only creating a new front end
  • static analysis tools that operate on intermediate representation

특허:

NA

잠재적 혁신 아이디어

현재 하루 4만 건이 넘는 봇 트래픽을 차단하기 위해 이 콘텐츠는 커뮤니티 회원만 이용할 수 있습니다.
> 로그인 < 또는 >등록 < 이 콘텐츠를 비롯한 모든 제한된 콘텐츠와 도구는 (100% 무료로) 이용할 수 있습니다.

Related to: compiler design, front end, middle end, back end, intermediate representation, ir, optimization, code generation, modularity, GCC, llvm.

역사적 맥락

3단계 컴파일러 구조

1975-06-01
1980
1980
1980
1986-01-01
1990
1990
1973
1980
1980
1980
1982-07-01
1988-06-01
1990
1993

(날짜를 알 수 없거나 관련이 없는 경우, 예를 들어 "유체역학"의 경우, 주목할 만한 등장 시기를 대략적으로 추정하여 제공합니다.)

관련 발명, 혁신 및 기술 원칙

고화질 이미지 및 다운로드는 등록된 회원에게만 100% 무료로 제공됩니다.

> 로그인 <