@@ -33,14 +33,14 @@ def CIRSimplify : Pass<"cir-simplify"> {
33
33
let summary = "Performs CIR simplification and code optimization";
34
34
let description = [{
35
35
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
+
38
38
Unlike the `cir-canonicalize` pass, these transformations may reduce the IR's
39
39
structural similarity to the original source code as a trade-off for improved
40
40
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
42
42
optimized constructs.
43
-
43
+
44
44
Example transformations include ternary expression folding and code hoisting
45
45
while preserving program semantics.
46
46
}];
@@ -72,4 +72,15 @@ def CIRFlattenCFG : Pass<"cir-flatten-cfg"> {
72
72
let dependentDialects = ["cir::CIRDialect"];
73
73
}
74
74
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
+
75
86
#endif // CLANG_CIR_DIALECT_PASSES_TD
0 commit comments