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

Iris Shi llvmlistbot at llvm.org
Sat May 10 10:09:56 PDT 2025


================
@@ -251,10 +251,7 @@ struct LoadStoreLikeOpRewriter : public OpRewritePattern<LoadStoreLikeOp> {
     // to do.
     SmallVector<OpFoldResult> indices =
         getAsOpFoldResult(loadStoreLikeOp.getIndices());
-    if (std::all_of(indices.begin(), indices.end(),
-                    [](const OpFoldResult &opFold) {
-                      return isConstantIntValue(opFold, 0);
-                    })) {
+    if (std::all_of(indices.begin(), indices.end(), isZeroIndex)) {
----------------
el-ev wrote:

```suggestion
    if (llvm::all_of(indices, isZeroIndex)) {
```


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


More information about the Mlir-commits mailing list