Skip to content

Commit 3cf0d5f

Browse files
keryelllanza
authored andcommitted
[CIR][Doc][NFC] Add a description for all the passes (#1282)
Some passes not declared with TableGen did not have descriptions.
1 parent d2e8197 commit 3cf0d5f

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

clang/include/clang/CIR/Dialect/Passes.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def HoistAllocas : Pass<"cir-hoist-allocas"> {
118118
}
119119

120120
def FlattenCFG : Pass<"cir-flatten-cfg"> {
121-
let summary = "Produces flatten cfg";
122-
let description = [{
121+
let summary = "Produces flatten CFG";
122+
let description = [{
123123
This pass transforms CIR and inline all the nested regions. Thus,
124124
the next post condtions are met after the pass applied:
125125
- there is not any nested region in a function body
@@ -132,7 +132,7 @@ def FlattenCFG : Pass<"cir-flatten-cfg"> {
132132
}
133133

134134
def GotoSolver : Pass<"cir-goto-solver"> {
135-
let summary = "Replaces goto operatations with branches";
135+
let summary = "Replaces goto operations with branches";
136136
let description = [{
137137
This pass transforms CIR and replaces goto-s with branch
138138
operations to the proper blocks.

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,11 @@ struct ConvertCIRToLLVMPass
13561356

13571357
void processCIRAttrs(mlir::ModuleOp moduleOp);
13581358

1359-
virtual StringRef getArgument() const override { return "cir-flat-to-llvm"; }
1359+
StringRef getDescription() const override {
1360+
return "Convert the prepared CIR dialect module to LLVM dialect";
1361+
}
1362+
1363+
StringRef getArgument() const override { return "cir-flat-to-llvm"; }
13601364
};
13611365

13621366
mlir::LogicalResult

clang/lib/CIR/Lowering/ThroughMLIR/LowerCIRToMLIR.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ struct ConvertCIRToMLIRPass
8686
}
8787
void runOnOperation() final;
8888

89-
virtual StringRef getArgument() const override { return "cir-to-mlir"; }
89+
StringRef getDescription() const override {
90+
return "Convert the CIR dialect module to MLIR standard dialects";
91+
}
92+
93+
StringRef getArgument() const override { return "cir-to-mlir"; }
9094
};
9195

9296
class CIRCallOpLowering : public mlir::OpConversionPattern<cir::CallOp> {

clang/lib/CIR/Lowering/ThroughMLIR/LowerMLIRToLLVM.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ struct ConvertMLIRToLLVMPass
4949
}
5050
void runOnOperation() final;
5151

52-
virtual StringRef getArgument() const override { return "cir-mlir-to-llvm"; }
52+
StringRef getDescription() const override {
53+
return "Convert the MLIR standard dialects produced from CIR to MLIR LLVM "
54+
"dialect";
55+
}
56+
57+
StringRef getArgument() const override { return "cir-mlir-to-llvm"; }
5358
};
5459

5560
void ConvertMLIRToLLVMPass::runOnOperation() {

0 commit comments

Comments
 (0)