File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
clang/include/clang/CIR/Dialect/IR Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -473,28 +473,23 @@ def CIR_PtrStrideOp : CIR_Op<"ptr_stride",[
473
473
def CIR_ConstantOp : CIR_Op<"const",[
474
474
ConstantLike, Pure, AllTypesMatch<["value", "res"]>
475
475
]> {
476
- // FIXME: Use SameOperandsAndResultType or similar and prevent eye bleeding
477
- // type repetition in the assembly form.
478
-
479
- let summary = "Defines a CIR constant";
476
+ let summary = "Create a CIR constant from a literal attribute";
480
477
let description = [{
481
478
The `cir.const` operation turns a literal into an SSA value. The data is
482
479
attached to the operation as an attribute.
483
480
484
481
```mlir
485
- %0 = cir.const 42 : i32
486
- %1 = cir.const 4.2 : f32
487
- %2 = cir.const nullptr : !cir.ptr<i32 >
482
+ %0 = cir.const #cir.int<4> : !u32i
483
+ %1 = cir.const #cir.fp<1.500000e+00> : !cir.float
484
+ %2 = cir.const #cir.ptr<null> : !cir.ptr<!void >
488
485
```
489
486
}];
490
487
491
- // The constant operation takes an attribute as the only input.
492
488
let arguments = (ins TypedAttrInterface:$value);
493
489
494
- // The constant operation returns a single value of CIR_AnyType.
495
490
let results = (outs CIR_AnyType:$res);
496
491
497
- let assemblyFormat = "attr-dict $value ";
492
+ let assemblyFormat = "$value attr-dict";
498
493
499
494
let hasVerifier = 1;
500
495
You can’t perform that action at this time.
0 commit comments