@@ -33,14 +33,14 @@ def CIRSimplify : Pass<"cir-simplify"> {
3333 let summary = "Performs CIR simplification and code optimization";
3434 let description = [{
3535 The pass performs semantics-preserving code simplifications and optimizations
36- on CIR while maintaining strict program correctness.
37-
36+ on CIR while maintaining strict program correctness.
37+
3838 Unlike the `cir-canonicalize` pass, these transformations may reduce the IR's
3939 structural similarity to the original source code as a trade-off for improved
4040 code quality. This can affect debugging fidelity by altering intermediate
41- representations of folded expressions, hoisted operations, and other
41+ representations of folded expressions, hoisted operations, and other
4242 optimized constructs.
43-
43+
4444 Example transformations include ternary expression folding and code hoisting
4545 while preserving program semantics.
4646 }];
@@ -72,4 +72,15 @@ def CIRFlattenCFG : Pass<"cir-flatten-cfg"> {
7272 let dependentDialects = ["cir::CIRDialect"];
7373}
7474
75+ def LoweringPrepare : Pass<"cir-lowering-prepare"> {
76+ let summary = "Lower to more fine-grained CIR operations before lowering to
77+ other dialects";
78+ let description = [{
79+ This pass does preparation work for lowering to other dialects. For example,
80+ it may expand the global variable initialziation in a more ABI-friendly form.
81+ }];
82+ let constructor = "mlir::createLoweringPreparePass()";
83+ let dependentDialects = ["cir::CIRDialect"];
84+ }
85+
7586#endif // CLANG_CIR_DIALECT_PASSES_TD
0 commit comments