[Mlir-commits] [mlir] [mlir][NFC] Simplify constant checks with isZeroIndex and isOneIndex. (PR #139340)

Han-Chung Wang llvmlistbot at llvm.org
Mon May 12 10:56:31 PDT 2025


================
@@ -28,6 +28,10 @@ namespace mlir {
 /// with attribute with value `0`.
 bool isZeroIndex(OpFoldResult v);
 
+/// Return true if `v` is an IntegerAttr with value `1` of a ConstantIndexOp
+/// with attribute with value `1`.
+bool isOneIndex(OpFoldResult v);
----------------
hanhanW wrote:

Thanks, it sounds good to me! I was following the other naming (i.e., `isZeroIndex`), and I had the same confusion. I'm happy to fix it this way.

https://github.com/llvm/llvm-project/pull/139340


More information about the Mlir-commits mailing list