CP25C04 Advanced Compiler Design L P T C
3 0 0 3
Course Objective:
To analyze the theory and principles of modern compiler design and advanced
optimization techniques.
To design and implement efficient front-end and back-end compiler
components for programming languages.
To evaluate code optimization strategies and runtime environment
management in contemporary architectures.
Intermediate Representations and Control Flow Analysis: Static single assignment
(SSA) form- Context-Free Grammer (CFG) construction-dominance relations-
Intermediate Representation (IR) design for functional and imperative languages-
Static single assignment and def-use chains
Activities:
1. Convert source code to SSA form using LLVM IR.
2. Visualize control flow graphs from SSA using LLVM tools.
Program Analysis and Transformations: Data flow analysis- live variable analysis-
reaching definitions-Alias analysis and dependence analysis-Loop optimizations and
transformations
Activities:
1. Perform loop unrolling and strength reduction.
2. Conduct live variable analysis and visualize data flow graphs.
Advanced Optimizations and Polyhedral Compilation: Polyhedral model for loop
nests-Tiling, skewing, fusion, and vectorization-Profile-guided and feedback-directed
optimizations
Activities:
1. Implement loop tiling and loop skewing on a matrix multiplication program.
2. Analyze the effect on loop-intensive code with LLVM optimization flags.
Just-in-Time (JIT) and Runtime Compilation: JIT compilation models: tracing,
method-based-GraalVM architecture, Java HotSpot internals-LLVM JIT and dynamic
language support
Activities:
1. Develop a basic JIT-enabled interpreter with LLVM or GraalVM.
2. Implement dynamic dispatch using LLVM JIT API.
Machine Learning in Compiler Design: ML for phase ordering, auto-tuning, and IR
prediction-Reinforcement learning for optimization passes-Dataset creation and
benchmarking for compiler ML
Activities:
1. Train an ML model to predict optimization passes.
2. Use reinforcement learning for pass selection in toy compiler.
Domain-Specific Languages (DSLs) and Compiler Extensions: Designing DSLs
for AI/ML, DSP, graphics-Code generation for custom accelerators-Integration with
TensorFlow XLA and Halide
Activities:
1. Design and test a simple DSL grammar using ANTLR.
2. Integrate a DSL with TensorFlow XLA or Halide.
Security, Verification, and Future Trends: Secure compilation and type-safe
intermediate representations-Compiler fuzzing and formal verification (e.g.,
CompCert)-Quantum compilers, multi-target compilers, and neuromorphic systems
Activities:
1. Use CompCert to verify compilation of simple programs.
2. Apply compiler fuzzing using tools like libFuzzer.
Weightage: Continuous Assessment: 40%, End Semester Examinations: 60%
Assessment Methodology: Assignments (15), Quiz (10), Virtual Demo (20),
Flipped
Class Room (10), Review of Gate and IES Questions (25), Project (20).
References:
1. Cooper, K. D., & Torczon, L. (2023). Engineering a compiler. Morgan Kaufmann.
2. Grune, D., Bal, H. E., Jacobs, C. J. H., & Langendoen, K. G. (2012). Modern
compiler design (2nd ed.). Springer.
3. Aho, A. V., Lam, M. S., Sethi, R., & Ullman, J. D. (2006). Compilers: Principles,
techniques, and tools (2nd ed.). Pearson.
4. Völter, M. (2013). DSL engineering: Designing, implementing and using domain-
specific languages. [Link].
5. Sarda, S., & Pandey, M. (2015). LLVM essentials. Packt Publishing.
E-Resources:
1. Prof. AmeyKarkare, IIT Kanpur, “Advanced Compiler Optimizations” Link:
[Link]
2. Prof. Santanu Chattopadhyay, “Compiler Design”, IIT Kharagpur
Link:” [Link]
Description of CO PO PSO
CO1 Explain intermediate control flow techniques in compiler _ _
design
CO2 Apply program analysis techniques and advanced
optimizations for design of compilers.
PO1(3) PSO1(3)
CO3 Develop compiler features and machine learning PO3(2) PSO2(2)
techniques for optimization.
CO4 Evaluate secure compilation strategies for quantum and PO2(1) PSO1(3)
multi-target compilation.