Skip to content

Commit 6c7c849

Browse files
xlaukolanza
authored andcommitted
[CIR][NFC] Clean up constant op comments (#1934)
1 parent e3d6193 commit 6c7c849

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -478,28 +478,23 @@ def CIR_PtrStrideOp : CIR_Op<"ptr_stride",[
478478
def CIR_ConstantOp : CIR_Op<"const",[
479479
ConstantLike, Pure, AllTypesMatch<["value", "res"]>
480480
]> {
481-
// FIXME: Use SameOperandsAndResultType or similar and prevent eye bleeding
482-
// type repetition in the assembly form.
483-
484-
let summary = "Defines a CIR constant";
481+
let summary = "Create a CIR constant from a literal attribute";
485482
let description = [{
486483
The `cir.const` operation turns a literal into an SSA value. The data is
487484
attached to the operation as an attribute.
488485

489486
```mlir
490-
%0 = cir.const 42 : i32
491-
%1 = cir.const 4.2 : f32
492-
%2 = cir.const nullptr : !cir.ptr<i32>
487+
%0 = cir.const #cir.int<4> : !u32i
488+
%1 = cir.const #cir.fp<1.500000e+00> : !cir.float
489+
%2 = cir.const #cir.ptr<null> : !cir.ptr<!void>
493490
```
494491
}];
495492

496-
// The constant operation takes an attribute as the only input.
497493
let arguments = (ins TypedAttrInterface:$value);
498494

499-
// The constant operation returns a single value of CIR_AnyType.
500495
let results = (outs CIR_AnyType:$res);
501496

502-
let assemblyFormat = "attr-dict $value";
497+
let assemblyFormat = "$value attr-dict";
503498

504499
let hasVerifier = 1;
505500

0 commit comments

Comments
 (0)