llvm-project
5ed852f7 - [mlir][arith] Add `arith::ConstantIntOp` constructor (#144638)

Commit
214 days ago
[mlir][arith] Add `arith::ConstantIntOp` constructor (#144638) This PR adds a `build()` constructor for `ConstantIntOp` that takes in an `APInt`. Creating an `arith` constant value with an `APInt` currently requires a structure like the following: ```c b.create<arith::ConstantOp>(IntegerAttr::get(apintValue, 5)); ``` In comparison, the`ConstantFloatOp` already has an `APFloat` constructor which allows for the following: ```c b.create<arith::ConstantFloatOp>(floatType, apfloatValue); ``` Thus, intuitively, it makes sense that a similar `ConstantIntOp` constructor is made for `APInts` like so: ```c b.create<arith::ConstantIntOp>(intType, apintValue); ``` Depends on https://github.com/llvm/llvm-project/pull/144636
Author
Parents
Loading