swift
f420468b - SILOptimizer: add a pass to perform target specific constant folding.

Commit
3 years ago
SILOptimizer: add a pass to perform target specific constant folding. TargetConstantFolding performs constant folding for target-specific values: ``` MemoryLayout<S>.size MemoryLayout<S>.alignment MemoryLayout<S>.stride ``` Constant folding those expressions in the middle of the SIL pipeline enables other optimizations to e.g. allow such expressions in statically allocated global variables (done by the GlobalOpt pass). The implementation requires to create a temporary IRGenModule, which is used to get actual constant sizes/alignments from IRGen's type lowering. rdar://94831524
Author
Committer
Parents
Loading