[Mlir-commits] [mlir] [mlir][affine]if the result of a Pure operation that whose operands are dimensional identifiers, then their results are dimensional identifiers. (PR #123542)

lonely eagle llvmlistbot at llvm.org
Sun Jan 26 05:33:43 PST 2025


================
@@ -225,18 +225,6 @@ func.func @affine_parallel(%arg0 : index, %arg1 : index, %arg2 : index) {
 
 // -----
 
-func.func @affine_parallel(%arg0 : index, %arg1 : index, %arg2 : index) {
-  affine.for %x = 0 to 7 {
-    %y = arith.addi %x, %x : index
-    // expected-error at +1 {{operand cannot be used as a dimension id}}
-    affine.parallel (%i, %j) = (0, 0) to (%y, 100) step (10, 10) {
-    }
-  }
-  return
-}
-
-// -----
----------------
linuxlonelyeagle wrote:

arith.addi is Pure, you can see below and https://mlir.llvm.org/docs/Dialects/ArithOps/#arithandi-arithandiop
```
def Pure : TraitList<[AlwaysSpeculatable, NoMemoryEffect]>;

// arith.addi
Traits: AlwaysSpeculatableImplTrait, Commutative, Elementwise, Idempotent, SameOperandsAndResultType, Scalarizable, Tensorizable, Vectorizable

Interfaces: ConditionallySpeculatable, InferIntRangeInterface, InferTypeOpInterface, NoMemoryEffect (MemoryEffectOpInterface), VectorUnrollOpInterface

Effects: MemoryEffects::Effect{}
```

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


More information about the Mlir-commits mailing list