Skip to content

[MLIR][Affine] Fix affine.apply verifier and add functionality to demote invalid symbols to dims #128289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

bondhugula
Copy link
Contributor

@bondhugula bondhugula commented Feb 22, 2025

Fixes: #120189, #128403

Fix affine.apply verifier to reject symbolic operands that are valid
dims for affine purposes. This doesn't affect other users in other
contexts where the operands were neither valid dims or symbols (for eg.
in scf.for or other region ops). Otherwise, it was possible for
-canonicalize to have generated invalid IR when such
affine.apply ops were composed.

Introduce a method to demote a symbolic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols). Demote
operands that could/should have been valid affine dimensional values
(affine loop IVs or their functions) from symbols to dims. This is a
general method that can be used to legalize a map + operands post
construction depending on its operands. Use it during
canonicalizeMapOrSetAndOperands so that pattern rewriter-based passes
are able to generate valid IR post folding. Users outside of affine
analyses/dialects remain unaffected.

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This PR also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).

@llvmbot
Copy link
Member

llvmbot commented Feb 22, 2025

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-affine

Author: Uday Bondhugula (bondhugula)

Changes

Fixes: #120189

Introduce a method to demote a symoblic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols).
Demote operands that could/should have been valid affine dimensional
values (affine loop IVs or their functions) from symbols to dims. This
is a general method that can be used to legalize a map + operands post
construction depending on its operands.

In several cases, affine.apply operands that could be dims for the
purpose of affine analysis were being used in symbolic positions
undetected. Fix the verifier so that affine dim-only SSA values aren't
used in symbolic positions; otherwise, it was possible for
-canonicalize to have generated invalid IR. This doesn't affect other
users in other context where the operands were neither valid dims or
symbols (for eg. in scf.for or other region ops).

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This PR also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
For several use cases, the IR builder/user wouldn't need to worry about
dim/symbols since canonicalizeMapOrSetAndOperands is updated to
transparently take care of it to ensure valid IR. Users outside of
affine analyses/dialects remain unaffected.


Full diff: https://github.com/llvm/llvm-project/pull/128289.diff

5 Files Affected:

  • (modified) mlir/lib/Dialect/Affine/IR/AffineOps.cpp (+61-2)
  • (modified) mlir/test/Dialect/Affine/canonicalize.mlir (+2-2)
  • (modified) mlir/test/Dialect/Affine/invalid.mlir (+14)
  • (modified) mlir/test/Dialect/Affine/loop-fusion-4.mlir (+4-4)
  • (modified) mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir (+18-18)
diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index 06493de2b09d4..609fb9ab6a3e7 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -568,6 +568,15 @@ LogicalResult AffineApplyOp::verify() {
   if (affineMap.getNumResults() != 1)
     return emitOpError("mapping must produce one value");
 
+  // Do not allow valid dims to be used in symbol positions. We do allow
+  // affine.apply to use operands for values that may neither qualify as affine
+  // dims or affine symbols due to usage outside of affine ops, analyses, etc.
+  Region *region = getAffineScope(*this);
+  for (Value operand : getMapOperands().drop_front(affineMap.getNumDims())) {
+    if (::isValidDim(operand, region) && !::isValidSymbol(operand, region))
+      return emitError("dimensional operand cannot be used as a symbol");
+  }
+
   return success();
 }
 
@@ -1351,13 +1360,62 @@ static void canonicalizePromotedSymbols(MapOrSet *mapOrSet,
 
   resultOperands.append(remappedSymbols.begin(), remappedSymbols.end());
   *operands = resultOperands;
-  *mapOrSet = mapOrSet->replaceDimsAndSymbols(dimRemapping, {}, nextDim,
-                                              oldNumSyms + nextSym);
+  *mapOrSet = mapOrSet->replaceDimsAndSymbols(
+      dimRemapping, /*symReplacements=*/{}, nextDim, oldNumSyms + nextSym);
 
   assert(mapOrSet->getNumInputs() == operands->size() &&
          "map/set inputs must match number of operands");
 }
 
+// A valid affine dimension may appear as a symbol in affine.apply operations.
+// This function canonicalizes symbols that are valid dims, but not valid
+// symbols into actual dims. Without such a legalization, the affine.apply will
+// be invalid. This method is the exact inverse of canonicalizePromotedSymbols.
+template <class MapOrSet>
+static void legalizeDemotedDims(MapOrSet *mapOrSet,
+                                SmallVectorImpl<Value> &operands) {
+  if (!mapOrSet || operands.empty())
+    return;
+
+  assert(mapOrSet->getNumInputs() == operands.size() &&
+         "map/set inputs must match number of operands");
+
+  auto *context = mapOrSet->getContext();
+  SmallVector<Value, 8> resultOperands;
+  resultOperands.reserve(operands.size());
+  SmallVector<Value, 8> remappedDims;
+  remappedDims.reserve(operands.size());
+  unsigned nextSym = 0;
+  unsigned nextDim = 0;
+  unsigned oldNumDims = mapOrSet->getNumDims();
+  SmallVector<AffineExpr, 8> symRemapping(mapOrSet->getNumSymbols());
+  for (unsigned i = 0, e = mapOrSet->getNumInputs(); i != e; ++i) {
+    if (i >= oldNumDims) {
+      if (operands[i] && isValidDim(operands[i]) &&
+          !isValidSymbol(operands[i])) {
+        // This is a valid dim that appears as a symbol, legalize it.
+        symRemapping[i - oldNumDims] =
+            getAffineDimExpr(oldNumDims + nextDim++, context);
+        remappedDims.push_back(operands[i]);
+      } else {
+        symRemapping[i - oldNumDims] = getAffineSymbolExpr(nextSym++, context);
+        resultOperands.push_back(operands[i]);
+      }
+    } else {
+      resultOperands.push_back(operands[i]);
+    }
+  }
+
+  resultOperands.insert(resultOperands.begin() + oldNumDims,
+                        remappedDims.begin(), remappedDims.end());
+  operands = resultOperands;
+  *mapOrSet = mapOrSet->replaceDimsAndSymbols(
+      /*dimReplacements=*/{}, symRemapping, oldNumDims + nextDim, nextSym);
+
+  assert(mapOrSet->getNumInputs() == operands.size() &&
+         "map/set inputs must match number of operands");
+}
+
 // Works for either an affine map or an integer set.
 template <class MapOrSet>
 static void canonicalizeMapOrSetAndOperands(MapOrSet *mapOrSet,
@@ -1372,6 +1430,7 @@ static void canonicalizeMapOrSetAndOperands(MapOrSet *mapOrSet,
          "map/set inputs must match number of operands");
 
   canonicalizePromotedSymbols<MapOrSet>(mapOrSet, operands);
+  legalizeDemotedDims<MapOrSet>(mapOrSet, *operands);
 
   // Check to see what dims are used.
   llvm::SmallBitVector usedDims(mapOrSet->getNumDims());
diff --git a/mlir/test/Dialect/Affine/canonicalize.mlir b/mlir/test/Dialect/Affine/canonicalize.mlir
index a9ac13ad71624..3a3114f8da63a 100644
--- a/mlir/test/Dialect/Affine/canonicalize.mlir
+++ b/mlir/test/Dialect/Affine/canonicalize.mlir
@@ -1460,8 +1460,8 @@ func.func @mod_of_mod(%lb: index, %ub: index, %step: index) -> (index, index) {
 func.func @prefetch_canonicalize(%arg0: memref<512xf32>) -> () {
   // CHECK: affine.for [[I_0_:%.+]] = 0 to 8 {
   affine.for %arg3 = 0 to 8  {
-    %1 = affine.apply affine_map<()[s0] -> (s0 * 64)>()[%arg3]
-    // CHECK: affine.prefetch [[PARAM_0_]][symbol([[I_0_]]) * 64], read, locality<3>, data : memref<512xf32>
+    %1 = affine.apply affine_map<(d0) -> (d0 * 64)>(%arg3)
+    // CHECK: affine.prefetch [[PARAM_0_]][[[I_0_]] * 64], read, locality<3>, data : memref<512xf32>
     affine.prefetch %arg0[%1], read, locality<3>, data : memref<512xf32>
   }
   return
diff --git a/mlir/test/Dialect/Affine/invalid.mlir b/mlir/test/Dialect/Affine/invalid.mlir
index 9bbd19c381163..9703c05fff8f6 100644
--- a/mlir/test/Dialect/Affine/invalid.mlir
+++ b/mlir/test/Dialect/Affine/invalid.mlir
@@ -563,3 +563,17 @@ func.func @no_upper_bound() {
   }
   return
 }
+
+// -----
+
+func.func @invalid_symbol() {
+  affine.for %arg1 = 0 to 1 {
+    affine.for %arg2 = 0 to 26 {
+      affine.for %arg3 = 0 to 23 {
+        affine.apply affine_map<()[s0, s1] -> (s0 * 23 + s1)>()[%arg1, %arg3]
+        // expected-error@above {{dimensional operand cannot be used as a symbol}}
+      }
+    }
+  }
+  return
+}
diff --git a/mlir/test/Dialect/Affine/loop-fusion-4.mlir b/mlir/test/Dialect/Affine/loop-fusion-4.mlir
index 9cc2dc1520623..a2a20b05a340f 100644
--- a/mlir/test/Dialect/Affine/loop-fusion-4.mlir
+++ b/mlir/test/Dialect/Affine/loop-fusion-4.mlir
@@ -360,8 +360,8 @@ func.func @same_memref_load_multiple_stores(%producer : memref<32xf32>, %produce
 
 // -----
 
-#map = affine_map<()[s0] -> (s0 + 5)>
-#map1 = affine_map<()[s0] -> (s0 + 17)>
+#map = affine_map<(d0) -> (d0 + 5)>
+#map1 = affine_map<(d0) -> (d0 + 17)>
 
 // Test with non-int/float memref types.
 
@@ -382,8 +382,8 @@ func.func @memref_index_type() {
   }
   affine.for %arg3 = 0 to 3 {
     %4 = affine.load %alloc_2[%arg3] : memref<3xindex>
-    %5 = affine.apply #map()[%4]
-    %6 = affine.apply #map1()[%3]
+    %5 = affine.apply #map(%4)
+    %6 = affine.apply #map1(%3)
     %7 = memref.load %alloc[%5, %6] : memref<8x18xf32>
     affine.store %7, %alloc_1[%arg3] : memref<3xf32>
   }
diff --git a/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir b/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
index 327cacf7d9a20..62f58d5585de4 100644
--- a/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
+++ b/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
@@ -496,8 +496,8 @@ func.func @fold_dynamic_subview_with_memref_store_expand_shape(%arg0 : memref<16
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0] -> (s0 * 3)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0)[s0] -> (d0 + s0)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0) -> (d0 * 3)>
 // CHECK-LABEL: fold_memref_alias_expand_shape_subview_load_store_dynamic_dim
 // CHECK-SAME: (%[[ARG0:.*]]: memref<2048x16xf32>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: index, %[[ARG3:.*]]: index, %[[ARG4:.*]]: index)
 func.func @fold_memref_alias_expand_shape_subview_load_store_dynamic_dim(%alloc: memref<2048x16xf32>, %c10: index, %c5: index, %c0: index, %sz0: index) {
@@ -518,16 +518,16 @@ func.func @fold_memref_alias_expand_shape_subview_load_store_dynamic_dim(%alloc:
 // CHECK-NEXT:   %[[DIM:.*]] = memref.dim %[[EXPAND_SHAPE]], %[[ARG3]] : memref<?x1x8x2xf32, strided<[16, 16, 2, 1], offset: ?>>
 // CHECK-NEXT:   affine.for %[[ARG4:.*]] = 0 to %[[DIM]] step 64 {
 // CHECK-NEXT:   affine.for %[[ARG5:.*]] = 0 to 16 step 16 {
-// CHECK-NEXT:   %[[VAL0:.*]] = affine.apply #[[$MAP0]]()[%[[ARG2]], %[[ARG4]]]
-// CHECK-NEXT:   %[[VAL1:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]]]
+// CHECK-NEXT:   %[[VAL0:.*]] = affine.apply #[[$MAP0]](%[[ARG4]])[%[[ARG2]]]
+// CHECK-NEXT:   %[[VAL1:.*]] = affine.apply #[[$MAP1]](%[[ARG5]])
 // CHECK-NEXT:   %[[VAL2:.*]] = affine.load %[[ARG0]][%[[VAL0]], %[[VAL1]]] : memref<2048x16xf32>
-// CHECK-NEXT:   %[[VAL3:.*]] = affine.apply #[[$MAP0]]()[%[[ARG2]], %[[ARG4]]]
+// CHECK-NEXT:   %[[VAL3:.*]] = affine.apply #[[$MAP0]](%[[ARG4]])[%[[ARG2]]]
 // CHECK-NEXT:   affine.store %[[VAL2]], %[[ARG0]][%[[VAL3]], %[[ARG5]]] : memref<2048x16xf32>
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<()[s0, s1] -> (s0 * 1024 + s1)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0 * 1024 + d1)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
 // CHECK-LABEL: fold_static_stride_subview_with_affine_load_store_expand_shape
 // CHECK-SAME: (%[[ARG0:.*]]: memref<1024x1024xf32>, %[[ARG1:.*]]: memref<1xf32>, %[[ARG2:.*]]: index)
 func.func @fold_static_stride_subview_with_affine_load_store_expand_shape(%arg0: memref<1024x1024xf32>, %arg1: memref<1xf32>, %arg2: index) -> f32 {
@@ -549,14 +549,14 @@ func.func @fold_static_stride_subview_with_affine_load_store_expand_shape(%arg0:
 // CHECK-NEXT:  affine.for %[[ARG4:.*]] = 0 to 1024 {
 // CHECK-NEXT:   affine.for %[[ARG5:.*]] = 0 to 1020 {
 // CHECK-NEXT:    affine.for %[[ARG6:.*]] = 0 to 1 {
-// CHECK-NEXT:     %[[IDX1:.*]] = affine.apply #[[$MAP0]]()[%[[ARG3]], %[[ARG4]]]
-// CHECK-NEXT:     %[[IDX2:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]], %[[ARG6]]]
+// CHECK-NEXT:     %[[IDX1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]], %[[ARG4]])
+// CHECK-NEXT:     %[[IDX2:.*]] = affine.apply #[[$MAP1]](%[[ARG5]], %[[ARG6]])
 // CHECK-NEXT:     affine.load %[[ARG0]][%[[IDX1]], %[[IDX2]]] : memref<1024x1024xf32>
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0, d1)[s0] -> (d0 + d1 + s0 * 1024)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0 * 1025 + d1)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
 // CHECK-LABEL: fold_static_stride_subview_with_affine_load_store_expand_shape_when_access_index_is_an_expression
 // CHECK-SAME: (%[[ARG0:.*]]: memref<1024x1024xf32>, %[[ARG1:.*]]: memref<1xf32>, %[[ARG2:.*]]: index)
 func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_when_access_index_is_an_expression(%arg0: memref<1024x1024xf32>, %arg1: memref<1xf32>, %arg2: index) -> f32 {
@@ -578,14 +578,14 @@ func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_when_a
 // CHECK-NEXT:  affine.for %[[ARG4:.*]] = 0 to 1024 {
 // CHECK-NEXT:   affine.for %[[ARG5:.*]] = 0 to 1020 {
 // CHECK-NEXT:    affine.for %[[ARG6:.*]] = 0 to 1 {
-// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]], %[[ARG4]])[%[[ARG3]]]
-// CHECK-NEXT:      %[[TMP3:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]], %[[ARG6]]]
+// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]], %[[ARG4]])
+// CHECK-NEXT:      %[[TMP3:.*]] = affine.apply #[[$MAP1]](%[[ARG5]], %[[ARG6]])
 // CHECK-NEXT:      affine.load %[[ARG0]][%[[TMP1]], %[[TMP3]]] : memref<1024x1024xf32>
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<()[s0] -> (s0 * 1024)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0) -> (d0 * 1024)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
 // CHECK-LABEL: fold_static_stride_subview_with_affine_load_store_expand_shape_with_constant_access_index
 // CHECK-SAME: (%[[ARG0:.*]]: memref<1024x1024xf32>, %[[ARG1:.*]]: memref<1xf32>, %[[ARG2:.*]]: index)
 func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_with_constant_access_index(%arg0: memref<1024x1024xf32>, %arg1: memref<1xf32>, %arg2: index) -> f32 {
@@ -608,8 +608,8 @@ func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_with_c
 // CHECK-NEXT:   affine.for %[[ARG4:.*]] = 0 to 1024 {
 // CHECK-NEXT:    affine.for %[[ARG5:.*]] = 0 to 1020 {
 // CHECK-NEXT:     affine.for %[[ARG6:.*]] = 0 to 1 {
-// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]]()[%[[ARG3]]]
-// CHECK-NEXT:      %[[TMP2:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]], %[[ARG6]]]
+// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]])
+// CHECK-NEXT:      %[[TMP2:.*]] = affine.apply #[[$MAP1]](%[[ARG5]], %[[ARG6]])
 // CHECK-NEXT:      memref.load %[[ARG0]][%[[TMP1]], %[[TMP2]]] : memref<1024x1024xf32>
 
 // -----
@@ -678,7 +678,7 @@ func.func @fold_load_keep_nontemporal(%arg0 : memref<12x32xf32>, %arg1 : index,
 // -----
 
 // CHECK-LABEL: func @fold_store_keep_nontemporal(
-//      CHECK:   memref.store %{{.+}}, %{{.+}}[%{{.+}}, %{{.+}}]  {nontemporal = true} : memref<12x32xf32> 
+//      CHECK:   memref.store %{{.+}}, %{{.+}}[%{{.+}}, %{{.+}}]  {nontemporal = true} : memref<12x32xf32>
 func.func @fold_store_keep_nontemporal(%arg0 : memref<12x32xf32>, %arg1 : index, %arg2 : index, %arg3 : index, %arg4 : index, %arg5 : f32) {
   %0 = memref.subview %arg0[%arg1, %arg2][4, 4][2, 3] :
     memref<12x32xf32> to memref<4x4xf32, strided<[64, 3], offset: ?>>

@llvmbot
Copy link
Member

llvmbot commented Feb 22, 2025

@llvm/pr-subscribers-mlir-memref

Author: Uday Bondhugula (bondhugula)

Changes

Fixes: #120189

Introduce a method to demote a symoblic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols).
Demote operands that could/should have been valid affine dimensional
values (affine loop IVs or their functions) from symbols to dims. This
is a general method that can be used to legalize a map + operands post
construction depending on its operands.

In several cases, affine.apply operands that could be dims for the
purpose of affine analysis were being used in symbolic positions
undetected. Fix the verifier so that affine dim-only SSA values aren't
used in symbolic positions; otherwise, it was possible for
-canonicalize to have generated invalid IR. This doesn't affect other
users in other context where the operands were neither valid dims or
symbols (for eg. in scf.for or other region ops).

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This PR also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
For several use cases, the IR builder/user wouldn't need to worry about
dim/symbols since canonicalizeMapOrSetAndOperands is updated to
transparently take care of it to ensure valid IR. Users outside of
affine analyses/dialects remain unaffected.


Full diff: https://github.com/llvm/llvm-project/pull/128289.diff

5 Files Affected:

  • (modified) mlir/lib/Dialect/Affine/IR/AffineOps.cpp (+61-2)
  • (modified) mlir/test/Dialect/Affine/canonicalize.mlir (+2-2)
  • (modified) mlir/test/Dialect/Affine/invalid.mlir (+14)
  • (modified) mlir/test/Dialect/Affine/loop-fusion-4.mlir (+4-4)
  • (modified) mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir (+18-18)
diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index 06493de2b09d4..609fb9ab6a3e7 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -568,6 +568,15 @@ LogicalResult AffineApplyOp::verify() {
   if (affineMap.getNumResults() != 1)
     return emitOpError("mapping must produce one value");
 
+  // Do not allow valid dims to be used in symbol positions. We do allow
+  // affine.apply to use operands for values that may neither qualify as affine
+  // dims or affine symbols due to usage outside of affine ops, analyses, etc.
+  Region *region = getAffineScope(*this);
+  for (Value operand : getMapOperands().drop_front(affineMap.getNumDims())) {
+    if (::isValidDim(operand, region) && !::isValidSymbol(operand, region))
+      return emitError("dimensional operand cannot be used as a symbol");
+  }
+
   return success();
 }
 
@@ -1351,13 +1360,62 @@ static void canonicalizePromotedSymbols(MapOrSet *mapOrSet,
 
   resultOperands.append(remappedSymbols.begin(), remappedSymbols.end());
   *operands = resultOperands;
-  *mapOrSet = mapOrSet->replaceDimsAndSymbols(dimRemapping, {}, nextDim,
-                                              oldNumSyms + nextSym);
+  *mapOrSet = mapOrSet->replaceDimsAndSymbols(
+      dimRemapping, /*symReplacements=*/{}, nextDim, oldNumSyms + nextSym);
 
   assert(mapOrSet->getNumInputs() == operands->size() &&
          "map/set inputs must match number of operands");
 }
 
+// A valid affine dimension may appear as a symbol in affine.apply operations.
+// This function canonicalizes symbols that are valid dims, but not valid
+// symbols into actual dims. Without such a legalization, the affine.apply will
+// be invalid. This method is the exact inverse of canonicalizePromotedSymbols.
+template <class MapOrSet>
+static void legalizeDemotedDims(MapOrSet *mapOrSet,
+                                SmallVectorImpl<Value> &operands) {
+  if (!mapOrSet || operands.empty())
+    return;
+
+  assert(mapOrSet->getNumInputs() == operands.size() &&
+         "map/set inputs must match number of operands");
+
+  auto *context = mapOrSet->getContext();
+  SmallVector<Value, 8> resultOperands;
+  resultOperands.reserve(operands.size());
+  SmallVector<Value, 8> remappedDims;
+  remappedDims.reserve(operands.size());
+  unsigned nextSym = 0;
+  unsigned nextDim = 0;
+  unsigned oldNumDims = mapOrSet->getNumDims();
+  SmallVector<AffineExpr, 8> symRemapping(mapOrSet->getNumSymbols());
+  for (unsigned i = 0, e = mapOrSet->getNumInputs(); i != e; ++i) {
+    if (i >= oldNumDims) {
+      if (operands[i] && isValidDim(operands[i]) &&
+          !isValidSymbol(operands[i])) {
+        // This is a valid dim that appears as a symbol, legalize it.
+        symRemapping[i - oldNumDims] =
+            getAffineDimExpr(oldNumDims + nextDim++, context);
+        remappedDims.push_back(operands[i]);
+      } else {
+        symRemapping[i - oldNumDims] = getAffineSymbolExpr(nextSym++, context);
+        resultOperands.push_back(operands[i]);
+      }
+    } else {
+      resultOperands.push_back(operands[i]);
+    }
+  }
+
+  resultOperands.insert(resultOperands.begin() + oldNumDims,
+                        remappedDims.begin(), remappedDims.end());
+  operands = resultOperands;
+  *mapOrSet = mapOrSet->replaceDimsAndSymbols(
+      /*dimReplacements=*/{}, symRemapping, oldNumDims + nextDim, nextSym);
+
+  assert(mapOrSet->getNumInputs() == operands.size() &&
+         "map/set inputs must match number of operands");
+}
+
 // Works for either an affine map or an integer set.
 template <class MapOrSet>
 static void canonicalizeMapOrSetAndOperands(MapOrSet *mapOrSet,
@@ -1372,6 +1430,7 @@ static void canonicalizeMapOrSetAndOperands(MapOrSet *mapOrSet,
          "map/set inputs must match number of operands");
 
   canonicalizePromotedSymbols<MapOrSet>(mapOrSet, operands);
+  legalizeDemotedDims<MapOrSet>(mapOrSet, *operands);
 
   // Check to see what dims are used.
   llvm::SmallBitVector usedDims(mapOrSet->getNumDims());
diff --git a/mlir/test/Dialect/Affine/canonicalize.mlir b/mlir/test/Dialect/Affine/canonicalize.mlir
index a9ac13ad71624..3a3114f8da63a 100644
--- a/mlir/test/Dialect/Affine/canonicalize.mlir
+++ b/mlir/test/Dialect/Affine/canonicalize.mlir
@@ -1460,8 +1460,8 @@ func.func @mod_of_mod(%lb: index, %ub: index, %step: index) -> (index, index) {
 func.func @prefetch_canonicalize(%arg0: memref<512xf32>) -> () {
   // CHECK: affine.for [[I_0_:%.+]] = 0 to 8 {
   affine.for %arg3 = 0 to 8  {
-    %1 = affine.apply affine_map<()[s0] -> (s0 * 64)>()[%arg3]
-    // CHECK: affine.prefetch [[PARAM_0_]][symbol([[I_0_]]) * 64], read, locality<3>, data : memref<512xf32>
+    %1 = affine.apply affine_map<(d0) -> (d0 * 64)>(%arg3)
+    // CHECK: affine.prefetch [[PARAM_0_]][[[I_0_]] * 64], read, locality<3>, data : memref<512xf32>
     affine.prefetch %arg0[%1], read, locality<3>, data : memref<512xf32>
   }
   return
diff --git a/mlir/test/Dialect/Affine/invalid.mlir b/mlir/test/Dialect/Affine/invalid.mlir
index 9bbd19c381163..9703c05fff8f6 100644
--- a/mlir/test/Dialect/Affine/invalid.mlir
+++ b/mlir/test/Dialect/Affine/invalid.mlir
@@ -563,3 +563,17 @@ func.func @no_upper_bound() {
   }
   return
 }
+
+// -----
+
+func.func @invalid_symbol() {
+  affine.for %arg1 = 0 to 1 {
+    affine.for %arg2 = 0 to 26 {
+      affine.for %arg3 = 0 to 23 {
+        affine.apply affine_map<()[s0, s1] -> (s0 * 23 + s1)>()[%arg1, %arg3]
+        // expected-error@above {{dimensional operand cannot be used as a symbol}}
+      }
+    }
+  }
+  return
+}
diff --git a/mlir/test/Dialect/Affine/loop-fusion-4.mlir b/mlir/test/Dialect/Affine/loop-fusion-4.mlir
index 9cc2dc1520623..a2a20b05a340f 100644
--- a/mlir/test/Dialect/Affine/loop-fusion-4.mlir
+++ b/mlir/test/Dialect/Affine/loop-fusion-4.mlir
@@ -360,8 +360,8 @@ func.func @same_memref_load_multiple_stores(%producer : memref<32xf32>, %produce
 
 // -----
 
-#map = affine_map<()[s0] -> (s0 + 5)>
-#map1 = affine_map<()[s0] -> (s0 + 17)>
+#map = affine_map<(d0) -> (d0 + 5)>
+#map1 = affine_map<(d0) -> (d0 + 17)>
 
 // Test with non-int/float memref types.
 
@@ -382,8 +382,8 @@ func.func @memref_index_type() {
   }
   affine.for %arg3 = 0 to 3 {
     %4 = affine.load %alloc_2[%arg3] : memref<3xindex>
-    %5 = affine.apply #map()[%4]
-    %6 = affine.apply #map1()[%3]
+    %5 = affine.apply #map(%4)
+    %6 = affine.apply #map1(%3)
     %7 = memref.load %alloc[%5, %6] : memref<8x18xf32>
     affine.store %7, %alloc_1[%arg3] : memref<3xf32>
   }
diff --git a/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir b/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
index 327cacf7d9a20..62f58d5585de4 100644
--- a/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
+++ b/mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir
@@ -496,8 +496,8 @@ func.func @fold_dynamic_subview_with_memref_store_expand_shape(%arg0 : memref<16
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0] -> (s0 * 3)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0)[s0] -> (d0 + s0)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0) -> (d0 * 3)>
 // CHECK-LABEL: fold_memref_alias_expand_shape_subview_load_store_dynamic_dim
 // CHECK-SAME: (%[[ARG0:.*]]: memref<2048x16xf32>, %[[ARG1:.*]]: index, %[[ARG2:.*]]: index, %[[ARG3:.*]]: index, %[[ARG4:.*]]: index)
 func.func @fold_memref_alias_expand_shape_subview_load_store_dynamic_dim(%alloc: memref<2048x16xf32>, %c10: index, %c5: index, %c0: index, %sz0: index) {
@@ -518,16 +518,16 @@ func.func @fold_memref_alias_expand_shape_subview_load_store_dynamic_dim(%alloc:
 // CHECK-NEXT:   %[[DIM:.*]] = memref.dim %[[EXPAND_SHAPE]], %[[ARG3]] : memref<?x1x8x2xf32, strided<[16, 16, 2, 1], offset: ?>>
 // CHECK-NEXT:   affine.for %[[ARG4:.*]] = 0 to %[[DIM]] step 64 {
 // CHECK-NEXT:   affine.for %[[ARG5:.*]] = 0 to 16 step 16 {
-// CHECK-NEXT:   %[[VAL0:.*]] = affine.apply #[[$MAP0]]()[%[[ARG2]], %[[ARG4]]]
-// CHECK-NEXT:   %[[VAL1:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]]]
+// CHECK-NEXT:   %[[VAL0:.*]] = affine.apply #[[$MAP0]](%[[ARG4]])[%[[ARG2]]]
+// CHECK-NEXT:   %[[VAL1:.*]] = affine.apply #[[$MAP1]](%[[ARG5]])
 // CHECK-NEXT:   %[[VAL2:.*]] = affine.load %[[ARG0]][%[[VAL0]], %[[VAL1]]] : memref<2048x16xf32>
-// CHECK-NEXT:   %[[VAL3:.*]] = affine.apply #[[$MAP0]]()[%[[ARG2]], %[[ARG4]]]
+// CHECK-NEXT:   %[[VAL3:.*]] = affine.apply #[[$MAP0]](%[[ARG4]])[%[[ARG2]]]
 // CHECK-NEXT:   affine.store %[[VAL2]], %[[ARG0]][%[[VAL3]], %[[ARG5]]] : memref<2048x16xf32>
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<()[s0, s1] -> (s0 * 1024 + s1)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0 * 1024 + d1)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
 // CHECK-LABEL: fold_static_stride_subview_with_affine_load_store_expand_shape
 // CHECK-SAME: (%[[ARG0:.*]]: memref<1024x1024xf32>, %[[ARG1:.*]]: memref<1xf32>, %[[ARG2:.*]]: index)
 func.func @fold_static_stride_subview_with_affine_load_store_expand_shape(%arg0: memref<1024x1024xf32>, %arg1: memref<1xf32>, %arg2: index) -> f32 {
@@ -549,14 +549,14 @@ func.func @fold_static_stride_subview_with_affine_load_store_expand_shape(%arg0:
 // CHECK-NEXT:  affine.for %[[ARG4:.*]] = 0 to 1024 {
 // CHECK-NEXT:   affine.for %[[ARG5:.*]] = 0 to 1020 {
 // CHECK-NEXT:    affine.for %[[ARG6:.*]] = 0 to 1 {
-// CHECK-NEXT:     %[[IDX1:.*]] = affine.apply #[[$MAP0]]()[%[[ARG3]], %[[ARG4]]]
-// CHECK-NEXT:     %[[IDX2:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]], %[[ARG6]]]
+// CHECK-NEXT:     %[[IDX1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]], %[[ARG4]])
+// CHECK-NEXT:     %[[IDX2:.*]] = affine.apply #[[$MAP1]](%[[ARG5]], %[[ARG6]])
 // CHECK-NEXT:     affine.load %[[ARG0]][%[[IDX1]], %[[IDX2]]] : memref<1024x1024xf32>
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0, d1)[s0] -> (d0 + d1 + s0 * 1024)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0 * 1025 + d1)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
 // CHECK-LABEL: fold_static_stride_subview_with_affine_load_store_expand_shape_when_access_index_is_an_expression
 // CHECK-SAME: (%[[ARG0:.*]]: memref<1024x1024xf32>, %[[ARG1:.*]]: memref<1xf32>, %[[ARG2:.*]]: index)
 func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_when_access_index_is_an_expression(%arg0: memref<1024x1024xf32>, %arg1: memref<1xf32>, %arg2: index) -> f32 {
@@ -578,14 +578,14 @@ func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_when_a
 // CHECK-NEXT:  affine.for %[[ARG4:.*]] = 0 to 1024 {
 // CHECK-NEXT:   affine.for %[[ARG5:.*]] = 0 to 1020 {
 // CHECK-NEXT:    affine.for %[[ARG6:.*]] = 0 to 1 {
-// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]], %[[ARG4]])[%[[ARG3]]]
-// CHECK-NEXT:      %[[TMP3:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]], %[[ARG6]]]
+// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]], %[[ARG4]])
+// CHECK-NEXT:      %[[TMP3:.*]] = affine.apply #[[$MAP1]](%[[ARG5]], %[[ARG6]])
 // CHECK-NEXT:      affine.load %[[ARG0]][%[[TMP1]], %[[TMP3]]] : memref<1024x1024xf32>
 
 // -----
 
-// CHECK-DAG: #[[$MAP0:.*]] = affine_map<()[s0] -> (s0 * 1024)>
-// CHECK-DAG: #[[$MAP1:.*]] = affine_map<()[s0, s1] -> (s0 + s1)>
+// CHECK-DAG: #[[$MAP0:.*]] = affine_map<(d0) -> (d0 * 1024)>
+// CHECK-DAG: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
 // CHECK-LABEL: fold_static_stride_subview_with_affine_load_store_expand_shape_with_constant_access_index
 // CHECK-SAME: (%[[ARG0:.*]]: memref<1024x1024xf32>, %[[ARG1:.*]]: memref<1xf32>, %[[ARG2:.*]]: index)
 func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_with_constant_access_index(%arg0: memref<1024x1024xf32>, %arg1: memref<1xf32>, %arg2: index) -> f32 {
@@ -608,8 +608,8 @@ func.func @fold_static_stride_subview_with_affine_load_store_expand_shape_with_c
 // CHECK-NEXT:   affine.for %[[ARG4:.*]] = 0 to 1024 {
 // CHECK-NEXT:    affine.for %[[ARG5:.*]] = 0 to 1020 {
 // CHECK-NEXT:     affine.for %[[ARG6:.*]] = 0 to 1 {
-// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]]()[%[[ARG3]]]
-// CHECK-NEXT:      %[[TMP2:.*]] = affine.apply #[[$MAP1]]()[%[[ARG5]], %[[ARG6]]]
+// CHECK-NEXT:      %[[TMP1:.*]] = affine.apply #[[$MAP0]](%[[ARG3]])
+// CHECK-NEXT:      %[[TMP2:.*]] = affine.apply #[[$MAP1]](%[[ARG5]], %[[ARG6]])
 // CHECK-NEXT:      memref.load %[[ARG0]][%[[TMP1]], %[[TMP2]]] : memref<1024x1024xf32>
 
 // -----
@@ -678,7 +678,7 @@ func.func @fold_load_keep_nontemporal(%arg0 : memref<12x32xf32>, %arg1 : index,
 // -----
 
 // CHECK-LABEL: func @fold_store_keep_nontemporal(
-//      CHECK:   memref.store %{{.+}}, %{{.+}}[%{{.+}}, %{{.+}}]  {nontemporal = true} : memref<12x32xf32> 
+//      CHECK:   memref.store %{{.+}}, %{{.+}}[%{{.+}}, %{{.+}}]  {nontemporal = true} : memref<12x32xf32>
 func.func @fold_store_keep_nontemporal(%arg0 : memref<12x32xf32>, %arg1 : index, %arg2 : index, %arg3 : index, %arg4 : index, %arg5 : f32) {
   %0 = memref.subview %arg0[%arg1, %arg2][4, 4][2, 3] :
     memref<12x32xf32> to memref<4x4xf32, strided<[64, 3], offset: ?>>

@bondhugula bondhugula force-pushed the uday/fix_affine_apply_verifier branch from 7b26cbe to ceec221 Compare March 2, 2025 12:46
@bondhugula bondhugula changed the title [MLIR][Affine] Add functionality to demote invalid symbols to dims [MLIR][Affine] Fix affine.apply verifier and add functionality to demote invalid symbols to dims Mar 2, 2025
@bondhugula bondhugula force-pushed the uday/fix_affine_apply_verifier branch from ceec221 to d05e6a7 Compare March 2, 2025 12:48
@bondhugula bondhugula removed the request for review from anonymoususer-1 March 3, 2025 04:22
@bondhugula bondhugula force-pushed the uday/fix_affine_apply_verifier branch from d05e6a7 to 5bb29d2 Compare March 27, 2025 09:59
Copy link
Contributor

@arnab-polymage arnab-polymage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bondhugula bondhugula force-pushed the uday/fix_affine_apply_verifier branch from 5bb29d2 to 5d7106f Compare April 22, 2025 22:51
…ote invalid symbols to dims

Fixes: llvm#120189,
llvm#128403

Fix affine.apply verifier to reject symbolic operands that are valid
dims for affine purposes. This doesn't affect other users in other
context where the operands were neither valid dims or symbols (for eg.
in scf.for or other region ops). Otherwise, it was possible for
`-canonicalize` to have generated invalid IR when such
affine.apply ops were composed.

Introduce a method to demote a symbolic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols).  Demote
operands that could/should have been valid affine dimensional values
(affine loop IVs or their functions) from symbols to dims. This is a
general method that can be used to legalize a map + operands post
construction depending on its operands. Use it during
`canonicalizeMapOrSetAndOperands` so that pattern rewriter-based passes
are able to generate valid IR post folding. Users outside of affine
analyses/dialects remain unaffected.

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This PR also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
@bondhugula bondhugula force-pushed the uday/fix_affine_apply_verifier branch from 5d7106f to f21e0c7 Compare April 22, 2025 23:28
@bondhugula
Copy link
Contributor Author

Windows build failures are unrelated to this PR. Merging.

@bondhugula bondhugula merged commit 8c74dc1 into llvm:main Apr 22, 2025
7 of 10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 22, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building mlir at step 5 "compile-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/21752

Here is the relevant piece of the build log for the reference
Step 5 (compile-openmp) failure: build (failure)
...
                  ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/Basic/PointerAuthOptions.h:74:58: warning: ‘clang::PointerAuthSchema::SelectedAuthenticationMode’ is too small to hold all values of ‘enum class clang::PointerAuthenticationMode’
   PointerAuthenticationMode SelectedAuthenticationMode : 2;
                                                          ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/Basic/PointerAuthOptions.h:75:39: warning: ‘clang::PointerAuthSchema::DiscriminationKind’ is too small to hold all values of ‘enum class clang::PointerAuthSchema::Discrimination’
   Discrimination DiscriminationKind : 2;
                                       ^
14.841 [1697/32/5430] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/APSIntType.cpp.o
14.851 [1696/32/5431] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BlockCounter.cpp.o
14.868 [1695/32/5432] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR -Itools/mlir/include -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include -Iinclude -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++1z -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/7/cassert:44:0,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:59:   required from here
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
   assert(mapOrSet->getNumInputs() == numOperands &&
          ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
   assert(mapOrSet->getNumInputs() == operands.size() &&
          ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:60:   required from here
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
   assert(mapOrSet->getNumInputs() == numOperands &&
          ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
   assert(mapOrSet->getNumInputs() == operands.size() &&
          ^
In file included from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ADT/iterator.h:12:0,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ADT/STLExtras.h:24,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/IR/Visitors.h:17,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/IR/AffineExpr.h:17,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/IR/AffineMap.h:17,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.h:16,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h:17,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:9:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ADT/iterator_range.h:65:13: warning: ‘IteratorT llvm::iterator_range<IteratorT>::end() const [with IteratorT = llvm::mapped_iterator<llvm::detail::SafeIntIterator<unsigned int, false>, mlir::affine::makeComposedFoldedMultiResultAffineApply(mlir::OpBuilder&, mlir::Location, mlir::AffineMap, llvm::ArrayRef<mlir::OpFoldResult>)::<lambda(unsigned int)>, mlir::OpFoldResult>]’ used but never defined
   IteratorT end() const { return end_iterator; }
             ^~~
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include/llvm/ADT/iterator_range.h:64:13: warning: ‘IteratorT llvm::iterator_range<IteratorT>::begin() const [with IteratorT = llvm::mapped_iterator<llvm::detail::SafeIntIterator<unsigned int, false>, mlir::affine::makeComposedFoldedMultiResultAffineApply(mlir::OpBuilder&, mlir::Location, mlir::AffineMap, llvm::ArrayRef<mlir::OpFoldResult>)::<lambda(unsigned int)>, mlir::OpFoldResult>]’ used but never defined
   IteratorT begin() const { return begin_iterator; }

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 22, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-ubuntu-22-cmake-build-only running on rocm-docker-ubu-22 while building mlir at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/203/builds/8397

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[5628/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CrossWindows.cpp.o
[5629/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CommonArgs.cpp.o
[5630/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Cuda.cpp.o
[5631/7779] Linking CXX shared library lib/libLLVMOrcJIT.so.21.0git
[5632/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Flang.cpp.o
[5633/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/DragonFly.cpp.o
[5634/7779] Creating library symlink lib/libLLVMOrcJIT.so
[5635/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/FreeBSD.cpp.o
[5636/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Darwin.cpp.o
[5637/7779] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/11/cassert:44,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:45:   required from here
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:46:   required from here
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
[5638/7779] Linking CXX shared library lib/libMLIRNVVMTarget.so.21.0git
[5639/7779] Linking CXX static library lib/libLLVMExegesis_static.a
[5640/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Fuchsia.cpp.o
[5641/7779] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
[5642/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Haiku.cpp.o
[5643/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Gnu.cpp.o
[5644/7779] Linking CXX shared library lib/libLLVMOrcDebugging.so.21.0git
[5645/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Hexagon.cpp.o
[5646/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HLSL.cpp.o
[5647/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPAMD.cpp.o
[5648/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Hurd.cpp.o
[5649/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/MipsLinux.cpp.o
[5650/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/MSP430.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[5628/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CrossWindows.cpp.o
[5629/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/CommonArgs.cpp.o
[5630/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Cuda.cpp.o
[5631/7779] Linking CXX shared library lib/libLLVMOrcJIT.so.21.0git
[5632/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Flang.cpp.o
[5633/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/DragonFly.cpp.o
[5634/7779] Creating library symlink lib/libLLVMOrcJIT.so
[5635/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/FreeBSD.cpp.o
[5636/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Darwin.cpp.o
[5637/7779] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/11/cassert:44,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:45:   required from here
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:46:   required from here
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
[5638/7779] Linking CXX shared library lib/libMLIRNVVMTarget.so.21.0git
[5639/7779] Linking CXX static library lib/libLLVMExegesis_static.a
[5640/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Fuchsia.cpp.o
[5641/7779] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
[5642/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Haiku.cpp.o
[5643/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Gnu.cpp.o
[5644/7779] Linking CXX shared library lib/libLLVMOrcDebugging.so.21.0git
[5645/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Hexagon.cpp.o
[5646/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HLSL.cpp.o
[5647/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPAMD.cpp.o
[5648/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/Hurd.cpp.o
[5649/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/MipsLinux.cpp.o
[5650/7779] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/MSP430.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 22, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-8-cmake-build-only running on rocm-docker-rhel-8 while building mlir at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/7210

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[5658/7779] Linking CXX shared library lib/libclangASTMatchers.so.21.0git
[5659/7779] Creating library symlink lib/libclangASTMatchers.so
[5660/7779] Linking CXX shared library lib/libLLVMSPIRVCodeGen.so.21.0git
[5661/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/DependencyGraph.cpp.o
[5662/7779] Creating library symlink lib/libLLVMSPIRVCodeGen.so
[5663/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteModernObjC.cpp.o
[5664/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/HeaderIncludeGen.cpp.o
[5665/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/TextDiagnostic.cpp.o
[5666/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/PrintPreprocessedOutput.cpp.o
[5667/7779] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/8/cassert:44,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:59:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
   assert(mapOrSet->getNumInputs() == numOperands &&
          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
   assert(mapOrSet->getNumInputs() == operands.size() &&
          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:60:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
   assert(mapOrSet->getNumInputs() == numOperands &&
          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
   assert(mapOrSet->getNumInputs() == operands.size() &&
          ^~~~~~~~
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
[5668/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteObjC.cpp.o
[5669/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/InclusionRewriter.cpp.o
[5670/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/VerifyDiagnosticConsumer.cpp.o
[5671/7779] Building CXX object tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/GeneratePCH.cpp.o
[5672/7779] Linking CXX shared library lib/libLLVMX86CodeGen.so.21.0git
[5673/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/HTMLPrint.cpp.o
[5674/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteMacros.cpp.o
[5675/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/ASTMerge.cpp.o
[5676/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/ChainedIncludesSource.cpp.o
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Frontend/ChainedIncludesSource.cpp:23:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Serialization/ASTReader.h:246:16: warning: ‘virtual bool clang::ASTReaderListener::visitInputFile(llvm::StringRef, llvm::StringRef, bool, bool, bool)’ was hidden [-Woverloaded-virtual]
   virtual bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
Step 7 (build cmake config) failure: build cmake config (failure)
...
[5658/7779] Linking CXX shared library lib/libclangASTMatchers.so.21.0git
[5659/7779] Creating library symlink lib/libclangASTMatchers.so
[5660/7779] Linking CXX shared library lib/libLLVMSPIRVCodeGen.so.21.0git
[5661/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/DependencyGraph.cpp.o
[5662/7779] Creating library symlink lib/libLLVMSPIRVCodeGen.so
[5663/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteModernObjC.cpp.o
[5664/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/HeaderIncludeGen.cpp.o
[5665/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/TextDiagnostic.cpp.o
[5666/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/PrintPreprocessedOutput.cpp.o
[5667/7779] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/8/cassert:44,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:59:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
   assert(mapOrSet->getNumInputs() == numOperands &&
          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
   assert(mapOrSet->getNumInputs() == operands.size() &&
          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:60:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
   assert(mapOrSet->getNumInputs() == numOperands &&
          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
   assert(mapOrSet->getNumInputs() == operands.size() &&
          ^~~~~~~~
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
[5668/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteObjC.cpp.o
[5669/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/InclusionRewriter.cpp.o
[5670/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/VerifyDiagnosticConsumer.cpp.o
[5671/7779] Building CXX object tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/GeneratePCH.cpp.o
[5672/7779] Linking CXX shared library lib/libLLVMX86CodeGen.so.21.0git
[5673/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/HTMLPrint.cpp.o
[5674/7779] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteMacros.cpp.o
[5675/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/ASTMerge.cpp.o
[5676/7779] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/ChainedIncludesSource.cpp.o
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Frontend/ChainedIncludesSource.cpp:23:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Serialization/ASTReader.h:246:16: warning: ‘virtual bool clang::ASTReaderListener::visitInputFile(llvm::StringRef, llvm::StringRef, bool, bool, bool)’ was hidden [-Woverloaded-virtual]
   virtual bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 22, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-9-cmake-build-only running on rocm-docker-rhel-9 while building mlir at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/205/builds/7188

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[5867/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporter.cpp.o
[5868/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallDescription.cpp.o
[5869/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SMTConstraintManager.cpp.o
[5870/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/AnalysisManager.cpp.o
[5871/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerManager.cpp.o
[5872/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SVals.cpp.o
[5873/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SymbolManager.cpp.o
[5874/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallEvent.cpp.o
[5875/7779] Linking CXX shared library lib/libclangSerialization.so.21.0git
[5876/7779] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/11/cassert:44,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:45:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:46:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
[5877/7779] Linking CXX shared library lib/libMLIRExecutionEngine.so.21.0git
[5878/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/WorkList.cpp.o
[5879/7779] Creating library symlink lib/libclangSerialization.so
[5880/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CoreEngine.cpp.o
[5881/7779] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
[5882/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExplodedGraph.cpp.o
[5883/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineC.cpp.o
[5884/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngine.cpp.o
[5885/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineCXX.cpp.o
[5886/7779] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[5887/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineObjC.cpp.o
[5888/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporterVisitors.cpp.o
[5889/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/HTMLDiagnostics.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[5867/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporter.cpp.o
[5868/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallDescription.cpp.o
[5869/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SMTConstraintManager.cpp.o
[5870/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/AnalysisManager.cpp.o
[5871/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerManager.cpp.o
[5872/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SVals.cpp.o
[5873/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SymbolManager.cpp.o
[5874/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CallEvent.cpp.o
[5875/7779] Linking CXX shared library lib/libclangSerialization.so.21.0git
[5876/7779] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/tools/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/11/cassert:44,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:45:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:46:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
[5877/7779] Linking CXX shared library lib/libMLIRExecutionEngine.so.21.0git
[5878/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/WorkList.cpp.o
[5879/7779] Creating library symlink lib/libclangSerialization.so
[5880/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CoreEngine.cpp.o
[5881/7779] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
[5882/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExplodedGraph.cpp.o
[5883/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineC.cpp.o
[5884/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngine.cpp.o
[5885/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineCXX.cpp.o
[5886/7779] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[5887/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineObjC.cpp.o
[5888/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporterVisitors.cpp.o
[5889/7779] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/HTMLDiagnostics.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 22, 2025

LLVM Buildbot has detected a new failure on builder flang-runtime-cuda-gcc running on as-builder-7 while building mlir at step 6 "build-flang-rt".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/152/builds/2208

Here is the relevant piece of the build log for the reference
Step 6 (build-flang-rt) failure: cmake (failure)
...
27.008 [527/19/6124] Linking CXX static library lib/libLLVMVECodeGen.a
27.009 [527/18/6125] Linking CXX static library lib/libLLVMXCoreCodeGen.a
27.010 [527/17/6126] Linking CXX static library lib/libLLVMLoongArchCodeGen.a
27.024 [527/16/6127] Linking CXX static library lib/libLLVMBPFCodeGen.a
27.035 [527/15/6128] Linking CXX static library lib/libLLVMNVPTXCodeGen.a
27.063 [526/15/6129] Linking CXX static library lib/libLLVMWebAssemblyCodeGen.a
27.068 [526/14/6130] Linking CXX static library lib/libMLIRNVVMTarget.a
27.071 [526/13/6131] Linking CXX static library lib/libLLVMSPIRVCodeGen.a
27.078 [526/12/6132] Linking CXX static library lib/libLLVMMipsCodeGen.a
27.082 [526/11/6133] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /usr/bin/g++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/build/tools/mlir/lib/Dialect/Affine/IR -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/build/tools/mlir/include -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/include -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/build/include -I/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/11/cassert:44,
                 from /home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]’:
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]’
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:45:   required from here
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::AffineMap’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of ‘void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]’:
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from ‘void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]’
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:46:   required from here
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/buildbot/worker/as-builder-7/ramdisk/flang-runtime-cuda-gcc/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of ‘->’ has non-pointer type ‘mlir::IntegerSet’
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
27.089 [526/10/6134] Linking CXX static library lib/libLLVMPowerPCCodeGen.a
27.118 [526/9/6135] Linking CXX static library lib/libLLVMARMCodeGen.a
27.131 [526/8/6136] Linking CXX static library lib/libLLVMRISCVCodeGen.a
27.139 [526/7/6137] Linking CXX static library lib/libLLVMHexagonCodeGen.a
27.180 [526/6/6138] Linking CXX static library lib/libLLVMAArch64CodeGen.a
27.197 [526/5/6139] Linking CXX static library lib/libLLVMX86CodeGen.a
28.025 [526/4/6140] Building AMDGPUGenRegisterInfo.inc...
28.262 [526/3/6141] Building CXX object lib/LTO/CMakeFiles/LLVMLTO.dir/LTO.cpp.o
28.325 [526/2/6142] Building AMDGPUGenRegisterBank.inc...
28.843 [526/1/6143] Linking CXX static library lib/libFortranEvaluate.a
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 22, 2025

LLVM Buildbot has detected a new failure on builder mlir-s390x-linux running on systemz-1 while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/117/builds/8969

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
51.418 [1078/4/3746] Building CXX object tools/mlir/lib/Target/SPIRV/Serialization/CMakeFiles/obj.MLIRSPIRVSerialization.dir/Serialization.cpp.o
51.423 [1077/4/3747] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/TypeToLLVM.cpp.o
51.463 [1076/4/3748] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRImport.dir/DebugImporter.cpp.o
51.467 [1075/4/3749] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/ModuleTranslation.cpp.o
51.470 [1074/4/3750] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/DebugTranslation.cpp.o
51.504 [1073/4/3751] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/Dialect/OpenMPCommon.cpp.o
51.508 [1072/4/3752] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/LoopAnnotationTranslation.cpp.o
51.513 [1071/4/3753] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRImport.dir/DataLayoutImporter.cpp.o
51.543 [1070/4/3754] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRImport.dir/TypeFromLLVM.cpp.o
51.549 [1069/4/3755] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/uweigand/sandbox/buildbot/mlir-s390x-linux/build/tools/mlir/lib/Dialect/Affine/IR -I/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/uweigand/sandbox/buildbot/mlir-s390x-linux/build/tools/mlir/include -I/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/include -I/home/uweigand/sandbox/buildbot/mlir-s390x-linux/build/include -I/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
In file included from /usr/include/c++/11/cassert:44,
                 from /home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/include/mlir/Analysis/Presburger/Matrix.h:21,
                 from /home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h:19,
                 from /home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/include/mlir/Analysis/FlatLinearValueConstraints.h:12,
                 from /home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/include/mlir/Interfaces/ValueBoundsOpInterface.h:12,
                 from /home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:21:
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of 'void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::AffineMap]':
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from 'void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::AffineMap]'
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:45:   required from here
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of '->' has non-pointer type 'mlir::AffineMap'
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of '->' has non-pointer type 'mlir::AffineMap'
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp: In instantiation of 'void legalizeDemotedDims(MapOrSet&, llvm::SmallVectorImpl<mlir::Value>&) [with MapOrSet = mlir::IntegerSet]':
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:32:   required from 'void canonicalizeMapOrSetAndOperands(MapOrSet*, llvm::SmallVectorImpl<mlir::Value>*) [with MapOrSet = mlir::IntegerSet]'
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1515:46:   required from here
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:10: error: base operand of '->' has non-pointer type 'mlir::IntegerSet'
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ^~~~~~~~
/home/uweigand/sandbox/buildbot/mlir-s390x-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:10: error: base operand of '->' has non-pointer type 'mlir::IntegerSet'
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ^~~~~~~~
51.551 [1069/3/3756] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRImport.dir/LoopAnnotationImporter.cpp.o
51.553 [1069/2/3757] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRImport.dir/LLVMImportInterface.cpp.o
51.575 [1069/1/3758] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRFromLLVMIRTranslationRegistration.dir/ConvertFromLLVMIR.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 22, 2025

LLVM Buildbot has detected a new failure on builder ppc64le-mlir-rhel-clang running on ppc64le-mlir-rhel-test while building mlir at step 5 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/129/builds/19360

Here is the relevant piece of the build log for the reference
Step 5 (build-check-mlir-build-only) failure: build (failure)
...
50.158 [204/8/4023] Linking CXX static library lib/libLLVMGlobalISel.a
50.162 [204/7/4024] Linking CXX static library lib/libMLIRExecutionEngineUtils.a
50.188 [203/7/4025] Linking CXX static library lib/libLLVMOrcJIT.a
50.208 [203/6/4026] Linking CXX static library lib/libMLIRTargetLLVM.a
50.255 [201/7/4027] Linking CXX static library lib/libMLIRROCDLTarget.a
50.256 [201/6/4028] Linking CXX static library lib/libMLIRNVVMTarget.a
50.548 [201/5/4029] Linking CXX executable tools/mlir/unittests/Dialect/LLVMIR/MLIRLLVMIRTests
50.612 [201/4/4030] Linking CXX executable tools/mlir/unittests/Dialect/OpenACC/MLIROpenACCTests
50.639 [201/3/4031] Linking CXX executable tools/mlir/unittests/Dialect/Transform/MLIRTransformDialectTests
71.938 [201/2/4032] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /home/buildbots/llvm-external-buildbots/clang.19.1.7/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/build/tools/mlir/lib/Dialect/Affine/IR -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/build/tools/mlir/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/build/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: error: member reference type 'mlir::AffineMap' is not a pointer
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ~~~~~~~~^
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:3: note: in instantiation of function template specialization 'legalizeDemotedDims<mlir::AffineMap>' requested here
 1443 |   legalizeDemotedDims<MapOrSet>(*mapOrSet, *operands);
      |   ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:3: note: in instantiation of function template specialization 'canonicalizeMapOrSetAndOperands<mlir::AffineMap>' requested here
 1510 |   canonicalizeMapOrSetAndOperands<AffineMap>(map, operands);
      |   ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: note: did you mean to use '.' instead?
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |                  ^~
      |                  .
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:18: error: member reference type 'mlir::AffineMap' is not a pointer
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ~~~~~~~~^
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:18: note: did you mean to use '.' instead?
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |                  ^~
      |                  .
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-mlir-rhel-test/ppc64le-mlir-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: error: member reference type 'mlir::IntegerSet' is not a pointer
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ~~~~~~~~^
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \

@bondhugula
Copy link
Contributor Author

This has introduced a trivial build failure; will be pushing the fix in a minute.

@bondhugula
Copy link
Contributor Author

This has introduced a trivial build failure; will be pushing the fix in a minute.

Fixed here: 85b35a9

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 23, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building mlir at step 6 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/29595

Here is the relevant piece of the build log for the reference
Step 6 (build-unified-tree) failure: build (failure)
...
4.696 [4012/12/113] Linking CXX executable bin/clang-installapi
4.696 [4012/11/114] Linking CXX executable bin/clang-include-cleaner
4.703 [4012/10/115] Linking CXX executable bin/clang-query
4.727 [4012/9/116] Linking CXX executable bin/clang-change-namespace
4.741 [4012/8/117] Linking CXX executable bin/find-all-symbols
5.162 [4012/7/118] Linking CXX executable bin/clangd-indexer
5.165 [4012/6/119] Linking CXX executable bin/clangd
5.215 [4012/5/120] Linking CXX executable bin/clangd-fuzzer
5.338 [4012/4/121] Linking CXX executable bin/clang-tidy
8.666 [4012/3/122] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/build/buildbot/premerge-monolithic-linux/build/tools/mlir/lib/Dialect/Affine/IR -I/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR -I/build/buildbot/premerge-monolithic-linux/build/tools/mlir/include -I/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/include -I/build/buildbot/premerge-monolithic-linux/build/include -I/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: error: member reference type 'mlir::AffineMap' is not a pointer
  assert(mapOrSet->getNumInputs() == numOperands &&
         ~~~~~~~~^
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^~~~
/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:3: note: in instantiation of function template specialization 'legalizeDemotedDims<mlir::AffineMap>' requested here
  legalizeDemotedDims<MapOrSet>(*mapOrSet, *operands);
  ^
/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:3: note: in instantiation of function template specialization 'canonicalizeMapOrSetAndOperands<mlir::AffineMap>' requested here
  canonicalizeMapOrSetAndOperands<AffineMap>(map, operands);
  ^
/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: note: did you mean to use '.' instead?
  assert(mapOrSet->getNumInputs() == numOperands &&
                 ^~
                 .
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^
/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:18: error: member reference type 'mlir::AffineMap' is not a pointer
  assert(mapOrSet->getNumInputs() == operands.size() &&
         ~~~~~~~~^
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^~~~
/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:18: note: did you mean to use '.' instead?
  assert(mapOrSet->getNumInputs() == operands.size() &&
                 ^~
                 .
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^
/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: error: member reference type 'mlir::IntegerSet' is not a pointer
  assert(mapOrSet->getNumInputs() == numOperands &&
         ~~~~~~~~^
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 23, 2025

LLVM Buildbot has detected a new failure on builder ppc64le-flang-rhel-clang running on ppc64le-flang-rhel-test while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/26001

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
18.991 [289/12/6489] Linking CXX executable tools/flang/unittests/Evaluate/expression.test
19.015 [289/11/6490] Linking CXX executable bin/llvm-extract
19.177 [289/10/6491] Linking CXX executable bin/diagtool
19.228 [289/9/6492] Linking CXX executable bin/clang-installapi
19.263 [289/8/6493] Linking CXX executable bin/clang-diff
19.288 [289/7/6494] Linking CXX executable bin/clang-refactor
19.300 [289/6/6495] Linking CXX shared module lib/CheckerOptionHandlingAnalyzerPlugin.so
19.397 [289/5/6496] Linking CXX shared module lib/SampleAnalyzerPlugin.so
19.445 [289/4/6497] Linking CXX shared module lib/CheckerDependencyHandlingAnalyzerPlugin.so
21.906 [289/3/6498] Building CXX object tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o
FAILED: tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o 
ccache /home/buildbots/llvm-external-buildbots/clang.19.1.7/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/mlir/lib/Dialect/Affine/IR -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/tools/mlir/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/build/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -MF tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o.d -o tools/mlir/lib/Dialect/Affine/IR/CMakeFiles/obj.MLIRAffineDialect.dir/AffineOps.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: error: member reference type 'mlir::AffineMap' is not a pointer
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ~~~~~~~~^
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1443:3: note: in instantiation of function template specialization 'legalizeDemotedDims<mlir::AffineMap>' requested here
 1443 |   legalizeDemotedDims<MapOrSet>(*mapOrSet, *operands);
      |   ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1510:3: note: in instantiation of function template specialization 'canonicalizeMapOrSetAndOperands<mlir::AffineMap>' requested here
 1510 |   canonicalizeMapOrSetAndOperands<AffineMap>(map, operands);
      |   ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: note: did you mean to use '.' instead?
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |                  ^~
      |                  .
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:18: error: member reference type 'mlir::AffineMap' is not a pointer
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |          ~~~~~~~~^
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^~~~
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1425:18: note: did you mean to use '.' instead?
 1425 |   assert(mapOrSet->getNumInputs() == operands.size() &&
      |                  ^~
      |                  .
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \
      |                           ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-flang-rhel-test/ppc64le-flang-rhel-clang-build/llvm-project/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:1392:18: error: member reference type 'mlir::IntegerSet' is not a pointer
 1392 |   assert(mapOrSet->getNumInputs() == numOperands &&
      |          ~~~~~~~~^
/usr/include/assert.h:90:27: note: expanded from macro 'assert'
   90 |      (static_cast <bool> (expr)                                         \

cferry-AMD pushed a commit to Xilinx/llvm-project that referenced this pull request May 2, 2025
…ote invalid symbols to dims (llvm#128289)

Fixes: llvm#120189,
llvm#128403

Fix affine.apply verifier to reject symbolic operands that are valid
dims for affine purposes. This doesn't affect other users in other
contexts where the operands were neither valid dims or symbols (for eg.
in scf.for or other region ops). Otherwise, it was possible for
`-canonicalize` to have generated invalid IR when such
affine.apply ops were composed.

Introduce a method to demote a symbolic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols).  Demote
operands that could/should have been valid affine dimensional values
(affine loop IVs or their functions) from symbols to dims. This is a
general method that can be used to legalize a map + operands post
construction depending on its operands. Use it during
`canonicalizeMapOrSetAndOperands` so that pattern rewriter-based passes
are able to generate valid IR post folding. Users outside of affine
analyses/dialects remain unaffected.

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This commit also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…ote invalid symbols to dims (llvm#128289)

Fixes: llvm#120189,
llvm#128403

Fix affine.apply verifier to reject symbolic operands that are valid
dims for affine purposes. This doesn't affect other users in other
contexts where the operands were neither valid dims or symbols (for eg.
in scf.for or other region ops). Otherwise, it was possible for
`-canonicalize` to have generated invalid IR when such
affine.apply ops were composed.

Introduce a method to demote a symbolic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols).  Demote
operands that could/should have been valid affine dimensional values
(affine loop IVs or their functions) from symbols to dims. This is a
general method that can be used to legalize a map + operands post
construction depending on its operands. Use it during
`canonicalizeMapOrSetAndOperands` so that pattern rewriter-based passes
are able to generate valid IR post folding. Users outside of affine
analyses/dialects remain unaffected.

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This commit also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…ote invalid symbols to dims (llvm#128289)

Fixes: llvm#120189,
llvm#128403

Fix affine.apply verifier to reject symbolic operands that are valid
dims for affine purposes. This doesn't affect other users in other
contexts where the operands were neither valid dims or symbols (for eg.
in scf.for or other region ops). Otherwise, it was possible for
`-canonicalize` to have generated invalid IR when such
affine.apply ops were composed.

Introduce a method to demote a symbolic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols).  Demote
operands that could/should have been valid affine dimensional values
(affine loop IVs or their functions) from symbols to dims. This is a
general method that can be used to legalize a map + operands post
construction depending on its operands. Use it during
`canonicalizeMapOrSetAndOperands` so that pattern rewriter-based passes
are able to generate valid IR post folding. Users outside of affine
analyses/dialects remain unaffected.

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This commit also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…ote invalid symbols to dims (llvm#128289)

Fixes: llvm#120189,
llvm#128403

Fix affine.apply verifier to reject symbolic operands that are valid
dims for affine purposes. This doesn't affect other users in other
contexts where the operands were neither valid dims or symbols (for eg.
in scf.for or other region ops). Otherwise, it was possible for
`-canonicalize` to have generated invalid IR when such
affine.apply ops were composed.

Introduce a method to demote a symbolic operand to a dimensional one
(the inverse of the current canonicalizePromotedSymbols).  Demote
operands that could/should have been valid affine dimensional values
(affine loop IVs or their functions) from symbols to dims. This is a
general method that can be used to legalize a map + operands post
construction depending on its operands. Use it during
`canonicalizeMapOrSetAndOperands` so that pattern rewriter-based passes
are able to generate valid IR post folding. Users outside of affine
analyses/dialects remain unaffected.

In some cases, this change also leads to better simplified operands,
duplicates eliminated as shown in one of the test cases where the same
operand appeared as a symbol and as a dim.

This commit also fixes test cases where dimensional positions should have
been ideally used with affine.apply (for affine loop IVs for example).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Mlir][affine] --affine-loop-fusion="fusion-compute-tolerance=0" crashes in Utils.cpp:293: mlir::presburger::mergeLocalVars
4 participants