Skip to content

[mlir] [XeGPU] Add XeGPU workgroup to subgroup pass #139477

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 19 commits into from
May 20, 2025

Conversation

nbpatel
Copy link
Contributor

@nbpatel nbpatel commented May 11, 2025

This PR adds the XeGPU workgroup (wg) to subgroup (sg) pass. The wg to sg pass transforms the xegpu wg level operations to subgroup operations based on the sg_layout and sg_data attribute. The PR adds transformation patterns for following Ops

  1. CreateNdDesc
  2. LoadNd
  3. StoreNd
  4. PrefetchNd
  5. UpdateNdOffset
  6. Dpas

@llvmbot
Copy link
Member

llvmbot commented May 11, 2025

@llvm/pr-subscribers-mlir-gpu

@llvm/pr-subscribers-mlir

Author: Nishant Patel (nbpatel)

Changes

This PR adds the XeGPU workgroup (wg) to subgroup (sg) pass. The wg to sg pass transforms the xegpu wg level operations to subgroup operations based on the sg_layout and sg_data attribute. The PR adds transformation patterns for following Ops

  1. CreateNdDesc
  2. LoadNd
  3. StoreNd
  4. PrefetchNd
  5. UpdateNdOffset
  6. Dpas

Patch is 32.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/139477.diff

6 Files Affected:

  • (modified) mlir/include/mlir/Dialect/XeGPU/Transforms/Passes.td (+19-12)
  • (modified) mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h (+4)
  • (modified) mlir/lib/Dialect/XeGPU/Transforms/CMakeLists.txt (+1)
  • (added) mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSg.cpp (+386)
  • (added) mlir/test/Dialect/XeGPU/xegpu-wg-to-sg-rr.mlir (+66)
  • (added) mlir/test/Dialect/XeGPU/xegpu-wg-to-sg.mlir (+82)
diff --git a/mlir/include/mlir/Dialect/XeGPU/Transforms/Passes.td b/mlir/include/mlir/Dialect/XeGPU/Transforms/Passes.td
index 3e81f2d0ed786..bdea88cfd7022 100644
--- a/mlir/include/mlir/Dialect/XeGPU/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/XeGPU/Transforms/Passes.td
@@ -6,7 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-
 #ifndef MLIR_DIALECT_XEGPU_TRANSFORMS_PASSES_TD
 #define MLIR_DIALECT_XEGPU_TRANSFORMS_PASSES_TD
 
@@ -18,9 +17,7 @@ def XeGPUFoldAliasOps : Pass<"xegpu-fold-alias-ops"> {
     The pass folds aliasing ops into XeGPU ops that they operate on the original
     source references.
   }];
-  let dependentDialects = [
-      "memref::MemRefDialect", "xegpu::XeGPUDialect"
-  ];
+  let dependentDialects = ["memref::MemRefDialect", "xegpu::XeGPUDialect"];
 }
 
 def XeGPUSubgroupDistribute : Pass<"xegpu-subgroup-distribute"> {
@@ -28,14 +25,24 @@ def XeGPUSubgroupDistribute : Pass<"xegpu-subgroup-distribute"> {
   let description = [{
     The pass distributes subgroup level (SIMD) XeGPU ops to work items.
   }];
-  let dependentDialects = [
-      "memref::MemRefDialect", "xegpu::XeGPUDialect", "vector::VectorDialect"
-  ];
-  let options = [
-    Option<"printOnly", "print-analysis-only", "bool",
-         /*default=*/"false",
-         "Print the result of the subgroup map propagation analysis and exit.">
-  ];
+  let dependentDialects = ["memref::MemRefDialect", "xegpu::XeGPUDialect",
+                           "vector::VectorDialect"];
+  let options = [Option<
+      "printOnly", "print-analysis-only", "bool",
+      /*default=*/"false",
+      "Print the result of the subgroup map propagation analysis and exit.">];
+}
+
+def XeGPUWgToSg : Pass<"xegpu-wg-to-sg", "::mlir::gpu::GPUModuleOp"> {
+  let summary = "Transform WorkGroup level XeGPU code to SubGroup level";
+  let description = [{
+    This transform pass distributes the workgroup level computation to
+    multiple subgroups based on the sg_layout and sg_data attributes.
+  }];
+
+  let dependentDialects = ["memref::MemRefDialect", "xegpu::XeGPUDialect",
+                           "vector::VectorDialect", "arith::ArithDialect",
+                           "gpu::GPUDialect", "index::IndexDialect"];
 }
 
 #endif // MLIR_DIALECT_XEGPU_TRANSFORMS_PASSES_TD
diff --git a/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h b/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h
index 3e94021c7a1ea..388ba32e1eebb 100644
--- a/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h
@@ -9,6 +9,8 @@
 #ifndef MLIR_DIALECT_XEGPU_TRANSFORMS_TRANSFORMS_H
 #define MLIR_DIALECT_XEGPU_TRANSFORMS_TRANSFORMS_H
 
+#include "mlir/Transforms/DialectConversion.h"
+
 namespace mlir {
 class RewritePatternSet;
 
@@ -18,6 +20,8 @@ namespace xegpu {
 void populateXeGPUFoldAliasOpsPatterns(RewritePatternSet &patterns);
 /// Appends patterns for XeGPU SIMT distribution into `patterns`.
 void populateXeGPUSubgroupDistributePatterns(RewritePatternSet &patterns);
+void populateXeGPUWgToSgPatterns(RewritePatternSet &patterns,
+                                 ConversionTarget &target);
 
 } // namespace xegpu
 } // namespace mlir
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/CMakeLists.txt b/mlir/lib/Dialect/XeGPU/Transforms/CMakeLists.txt
index 901e02d3c9cf5..b258921cc87fd 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/XeGPU/Transforms/CMakeLists.txt
@@ -1,6 +1,7 @@
 add_mlir_dialect_library(MLIRXeGPUTransforms
   XeGPUFoldAliasOps.cpp
   XeGPUSubgroupDistribute.cpp
+  XeGPUWgToSg.cpp
 
   ADDITIONAL_HEADER_DIRS
   ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/XeGPU
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSg.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSg.cpp
new file mode 100644
index 0000000000000..5eabb04e3b858
--- /dev/null
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSg.cpp
@@ -0,0 +1,386 @@
+//===- XeGPUWgToSg.cpp - XeGPU WorkGroup to Subgroup Pass -------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#include "mlir/Dialect/XeGPU/Transforms/Passes.h"
+
+#include "mlir/Dialect/Index/IR/IndexDialect.h"
+#include "mlir/Dialect/MemRef/IR/MemRef.h"
+#include "mlir/Dialect/Utils/IndexingUtils.h"
+#include "mlir/Dialect/XeGPU/IR/XeGPU.h"
+#include "mlir/Dialect/XeGPU/Transforms/Transforms.h"
+#include "mlir/Transforms/DialectConversion.h"
+#include "llvm/Support/Debug.h"
+#include <mlir/Dialect/GPU/IR/GPUDialect.h>
+#include <mlir/Dialect/Index/IR/IndexOps.h>
+#include <numeric>
+
+namespace mlir {
+namespace xegpu {
+#define GEN_PASS_DEF_XEGPUWGTOSG
+#include "mlir/Dialect/XeGPU/Transforms/Passes.h.inc"
+} // namespace xegpu
+} // namespace mlir
+
+#define DEBUG_TYPE "xegpu-wg-to-sg"
+#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
+#define LDBG(X) LLVM_DEBUG(DBGS() << X << "\n")
+
+using namespace mlir;
+
+namespace {
+
+// clang-format off
+/// This pattern transforms the CreateNdDescOp to create a subgroup descriptor
+/// from a workgroup descriptor. It replaces the offsets and sizes with
+/// appropriate values for the subgroup.
+/// It uses round-robin assignment to distribute the work to the subgroups.
+/// Following create_nd_desc operation:,
+///    %tdesc = xegpu.create_nd_tdesc %src[0, 0] : memref<24x24xf32>
+///       -> !xegpu.tensor_desc<24x24xf32, #xegpu.layout<sg_layout = [4, 4],
+///           sg_data = [2, 2], lane_layout = [2, 2], lane_data = [1, 1]>>
+/// is converted to 9 subgroup level operations based on the sg_layout & sg_data:
+///    %tdesc = xegpu.create_nd_tdesc %src[off1, off2] : memref<24x24xf32> ->
+///           !xegpu.tensor_desc<2x2xf32, #xegpu.layout<lane_layout = [2, 2], lane_data = [1, 1]>>
+///
+/// The sg_layout and sg_data attributes are dropped after the pass as they are no longer needed.
+///
+/// 24x24 matrix distribution example:
+/// sg_layout = [4, 4], sg_data = [2, 2]
+/// Each 8x8 matrix within the 24x24 matrix is called a distribution unit.
+/// dist_unit_shape = [8, 8] --> sg_layout[i] * sg_data[i]
+///
+/// +------------------------+
+/// | 8x8 | 8x8 | 8x8 |      <- 3 tiles across
+/// |-----+-----+-----|
+/// | 8x8 | 8x8 | 8x8 |      <- 3 tiles down
+/// |-----+-----+-----|
+/// | 8x8 | 8x8 | 8x8 |
+/// +------------------------+
+///
+/// Each 8x8 tile is further subdivided among subgroups:
+/// +------------------------+
+/// | 2x2 2x2 2x2 2x2 |  <- 4 subgroups across (each handles 2 columns)
+/// | 2x2 2x2 2x2 2x2 |  <- 4 subgroups down (each handles 2 rows)
+/// | 2x2 2x2 2x2 2x2 |
+/// | 2x2 2x2 2x2 2x2 |
+/// +------------------------+
+///
+/// Since the 24x24 matrix is divided into 8x8 distribution units, there will be 9
+/// distribution units (3x3) in total. Hence the 9 subgroup level operations.
+// clang-format on
+struct WgToSgCreateNdOp : public OpConversionPattern<xegpu::CreateNdDescOp> {
+  using OpConversionPattern<xegpu::CreateNdDescOp>::OpConversionPattern;
+
+  // Helper to extract mixed offsets into a Value array
+  SmallVector<Value> extractOffsets(ConversionPatternRewriter &rewriter,
+                                    xegpu::CreateNdDescOp op) const {
+    llvm::SmallVector<Value> offsets;
+    auto staticOffsets = op.getStaticOffsets();
+    auto dynamicOffsets = op.getOffsets();
+
+    for (size_t i = 0, j = 0; i != staticOffsets.size(); i++) {
+      if (ShapedType::isDynamic(staticOffsets[i])) {
+        offsets.push_back(dynamicOffsets[j++]);
+      } else {
+        offsets.push_back(rewriter.create<arith::ConstantIndexOp>(
+            op.getLoc(), staticOffsets[i]));
+      }
+    }
+    return offsets;
+  }
+
+  // Convert linear subgroup ID to 2D coordinates
+  // TODO: Delinearize for nD
+  SmallVector<Value> delinearizeSubgroupId(ConversionPatternRewriter &rewriter,
+                                           Location loc, Value sgID,
+                                           Value sgDimX, Value sgDimY) const {
+    return {rewriter.create<index::DivUOp>(loc, sgID, sgDimY),
+            rewriter.create<index::RemUOp>(loc, sgID, sgDimY)};
+  }
+
+  // Create a constant index value
+  Value createConstantIndex(ConversionPatternRewriter &rewriter, Location loc,
+                            int64_t value) const {
+    return rewriter.create<arith::ConstantIndexOp>(loc, value);
+  }
+
+  // Calculate offset for each subgroup
+  SmallVector<OpFoldResult>
+  calculateGlobalOffsets(ConversionPatternRewriter &rewriter, Location loc,
+                         const SmallVector<Value> &originalOffsets,
+                         const SmallVector<Value> &localOffset,
+                         const SmallVector<int64_t> &distUnitBaseAddr) const {
+
+    Value constOffsetX =
+        createConstantIndex(rewriter, loc, distUnitBaseAddr[0]);
+    Value constOffsetY =
+        createConstantIndex(rewriter, loc, distUnitBaseAddr[1]);
+
+    Value offsetX =
+        rewriter.createOrFold<index::AddOp>(loc, localOffset[0], constOffsetX);
+    Value offsetY =
+        rewriter.createOrFold<index::AddOp>(loc, localOffset[1], constOffsetY);
+
+    size_t lastDimIndex = originalOffsets.size() - 1;
+    size_t secondLastDimIndex = lastDimIndex - 1;
+
+    Value globalOffsetX = rewriter.createOrFold<index::AddOp>(
+        loc, originalOffsets[secondLastDimIndex], offsetX);
+    Value globalOffsetY = rewriter.createOrFold<index::AddOp>(
+        loc, originalOffsets[lastDimIndex], offsetY);
+
+    SmallVector<OpFoldResult> globalOffsets(originalOffsets.begin(),
+                                            originalOffsets.end());
+    globalOffsets[secondLastDimIndex] = globalOffsetX;
+    globalOffsets[lastDimIndex] = globalOffsetY;
+
+    return globalOffsets;
+  }
+
+  LogicalResult
+  matchAndRewrite(xegpu::CreateNdDescOp op, OneToNOpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    Location loc = op.getLoc();
+    MLIRContext *ctx = op.getContext();
+    xegpu::TensorDescType tdescTy = op.getType();
+    auto layout = dyn_cast<xegpu::LayoutAttr>(tdescTy.getLayout());
+    Type elemTy = tdescTy.getElementType();
+    ArrayRef<int64_t> wgShape = tdescTy.getShape();
+    ArrayRef<int64_t> sgShape =
+        llvm::to_vector_of<int64_t>(layout.getSgData().asArrayRef());
+    ArrayRef<int64_t> sgLayout =
+        llvm::to_vector_of<int64_t>(layout.getSgLayout().asArrayRef());
+
+    // Get the subgroup ID
+    auto linearSgId = rewriter.create<gpu::SubgroupIdOp>(loc, nullptr);
+
+    // Create constants for layout dimensions
+    SmallVector<Value> sgLayoutDim(sgLayout.size());
+    SmallVector<Value> sgDataDim(sgShape.size());
+
+    for (size_t i = 0; i < sgLayout.size(); i++) {
+      sgLayoutDim[i] = createConstantIndex(rewriter, loc, sgLayout[i]);
+      sgDataDim[i] = createConstantIndex(rewriter, loc, sgShape[i]);
+    }
+
+    // Delinearize the 1D subgroup id into 2d
+    SmallVector<Value> sgIds = delinearizeSubgroupId(
+        rewriter, loc, linearSgId, sgLayoutDim[0], sgLayoutDim[1]);
+
+    // Calculate distribution unit shape and local offsets for subgroup
+    SmallVector<int64_t> distUnitShape(sgLayout.size());
+    SmallVector<Value> localOffset(sgLayout.size());
+    for (size_t i = 0; i < sgLayout.size(); i++) {
+      distUnitShape[i] = sgLayout[i] * sgShape[i];
+      localOffset[i] =
+          rewriter.createOrFold<index::MulOp>(loc, sgIds[i], sgDataDim[i]);
+    }
+
+    SmallVector<Value> originalOffsets = extractOffsets(rewriter, op);
+
+    xegpu::TensorDescType newTdescTy =
+        xegpu::TensorDescType::get(ctx, sgShape, elemTy, tdescTy.getEncoding(),
+                                   layout.dropSgLayoutAndData());
+    SmallVector<Value> newCreateNdOps;
+    for (const SmallVector<int64_t> &distUnitBaseAddr :
+         StaticTileOffsetRange(wgShape, distUnitShape)) {
+      SmallVector<OpFoldResult> globalOffsets = calculateGlobalOffsets(
+          rewriter, loc, originalOffsets, localOffset, distUnitBaseAddr);
+
+      auto newCreateNdOp = rewriter.create<xegpu::CreateNdDescOp>(
+          loc, newTdescTy, op.getSource(), globalOffsets, op.getMixedSizes(),
+          op.getMixedStrides());
+      newCreateNdOps.push_back(newCreateNdOp);
+    }
+
+    rewriter.replaceOpWithMultiple(op, {newCreateNdOps});
+    return success();
+  }
+};
+
+/// This pattern transforms the LoadNdOp to load subgroup data.
+struct WgToSgLoadNdOp : public OpConversionPattern<xegpu::LoadNdOp> {
+  using OpConversionPattern<xegpu::LoadNdOp>::OpConversionPattern;
+  LogicalResult
+  matchAndRewrite(xegpu::LoadNdOp op, OneToNOpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    SmallVector<Value> newLoadOps;
+    for (auto src : adaptor.getTensorDesc()) {
+      xegpu::TensorDescType tdescTy =
+          dyn_cast<xegpu::TensorDescType>(src.getType());
+      ArrayRef<int64_t> srcShape = tdescTy.getShape();
+      VectorType newResTy = VectorType::get(srcShape, tdescTy.getElementType());
+      auto newLoadOp = rewriter.create<xegpu::LoadNdOp>(op.getLoc(), newResTy,
+                                                        src, op->getAttrs());
+      newLoadOps.push_back(newLoadOp);
+    }
+    rewriter.replaceOpWithMultiple(op, {newLoadOps});
+    return mlir::success();
+  }
+};
+
+/// This pattern transforms the StoreNdOp to store to a subgroup descriptor
+/// It creates a StoreNdOp op to store the updated values to the new subgroup
+/// src tensor descriptors.
+struct WgToSgStoreNdOp : public OpConversionPattern<xegpu::StoreNdOp> {
+  using OpConversionPattern<xegpu::StoreNdOp>::OpConversionPattern;
+  LogicalResult
+  matchAndRewrite(xegpu::StoreNdOp op, OneToNOpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    for (auto [v, t] : llvm::zip(adaptor.getValue(), adaptor.getTensorDesc()))
+      rewriter.create<xegpu::StoreNdOp>(op.getLoc(), v, t, op.getL1HintAttr(),
+                                        op.getL2HintAttr(), op.getL3HintAttr());
+
+    rewriter.eraseOp(op);
+    return success();
+  }
+};
+
+/// This pattern transforms the UpdateNdOffsetOp to update the offsets of a
+/// subgroup descriptor. It creates an UpdateNdOffsetOp op to update the
+/// offsets of the new subgroup src tensor descriptors.
+struct WgToSgUpdateNdOffsetOp
+    : public OpConversionPattern<xegpu::UpdateNdOffsetOp> {
+  using OpConversionPattern<xegpu::UpdateNdOffsetOp>::OpConversionPattern;
+  LogicalResult
+  matchAndRewrite(xegpu::UpdateNdOffsetOp op, OneToNOpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    llvm::SmallVector<Value> newUpdateTileOffsetOps;
+    for (auto tDesc : adaptor.getTensorDesc()) {
+      auto newUpdateTileOffsetOp = rewriter.create<xegpu::UpdateNdOffsetOp>(
+          op.getLoc(), tDesc.getType(), tDesc, op.getOffsets(),
+          op.getConstOffsets());
+      newUpdateTileOffsetOps.push_back(newUpdateTileOffsetOp);
+    }
+
+    rewriter.replaceOpWithMultiple(op, {newUpdateTileOffsetOps});
+    return success();
+  }
+};
+
+/// This pattern transforms the DpasOp to work at subgroup level.
+struct WgToSgDpasOp : public OpConversionPattern<xegpu::DpasOp> {
+  using OpConversionPattern<xegpu::DpasOp>::OpConversionPattern;
+  LogicalResult
+  matchAndRewrite(xegpu::DpasOp op, OneToNOpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    Location loc = op.getLoc();
+    VectorType resultTy = op.getResult().getType();
+    if (resultTy.getRank() != 2)
+      return failure();
+
+    auto originalLayout =
+        llvm::dyn_cast_or_null<xegpu::LayoutAttr>(op->getAttr("layout"));
+    if (!originalLayout)
+      return failure();
+
+    SmallVector<Value> newDpasOps;
+    size_t i = 0;
+    for (auto aVec : adaptor.getLhs()) {
+      for (auto bVec : adaptor.getRhs()) {
+
+        llvm::SmallVector<Value> operands({aVec, bVec});
+        Value tmpC;
+        if (op.getAcc()) {
+          tmpC = adaptor.getAcc()[i++];
+          operands.push_back(tmpC);
+        }
+
+        ArrayRef<int64_t> aVecShape =
+            llvm::cast<VectorType>(aVec.getType()).getShape();
+        ArrayRef<int64_t> bVecShape =
+            llvm::cast<VectorType>(bVec.getType()).getShape();
+        VectorType resTy = VectorType::get({aVecShape[0], bVecShape[1]},
+                                           resultTy.getElementType());
+        tmpC = rewriter.create<xegpu::DpasOp>(
+            loc, resTy, operands,
+            llvm::ArrayRef<NamedAttribute>(
+                {"layout", originalLayout.dropSgLayoutAndData()}));
+        newDpasOps.push_back(tmpC);
+      }
+    }
+    rewriter.replaceOpWithMultiple(op, {newDpasOps});
+    return success();
+  }
+};
+
+/// This pattern transforms the PrefetchNdOp to prefetch the subgroup data.
+struct WgToSgPrefetchNdOp : public OpConversionPattern<xegpu::PrefetchNdOp> {
+  using OpConversionPattern<xegpu::PrefetchNdOp>::OpConversionPattern;
+  LogicalResult
+  matchAndRewrite(xegpu::PrefetchNdOp op, OneToNOpAdaptor adaptor,
+                  ConversionPatternRewriter &rewriter) const override {
+    for (auto src : adaptor.getTensorDesc()) {
+      rewriter.create<xegpu::PrefetchNdOp>(op.getLoc(), TypeRange(), src,
+                                           op->getAttrs());
+    }
+    rewriter.eraseOp(op);
+    return success();
+  }
+};
+
+} // namespace
+
+namespace mlir {
+namespace xegpu {
+void populateXeGPUWgToSgPatterns(RewritePatternSet &patterns) {
+  patterns.add<WgToSgCreateNdOp, WgToSgLoadNdOp, WgToSgStoreNdOp,
+               WgToSgUpdateNdOffsetOp, WgToSgDpasOp, WgToSgPrefetchNdOp>(
+      patterns.getContext());
+}
+} // namespace xegpu
+} // namespace mlir
+
+namespace {
+struct XeGPUWgToSgPass : public xegpu::impl::XeGPUWgToSgBase<XeGPUWgToSgPass> {
+  void runOnOperation() override;
+};
+} // namespace
+
+void XeGPUWgToSgPass::runOnOperation() {
+  MLIRContext *ctx = &getContext();
+  RewritePatternSet patterns(ctx);
+  ConversionTarget target(*ctx);
+
+  auto getTensorDescType = [](Operation *op) -> xegpu::TensorDescType {
+    if (auto createOp = dyn_cast<xegpu::CreateNdDescOp>(op))
+      return createOp.getType();
+    if (auto loadOp = dyn_cast<xegpu::LoadNdOp>(op))
+      return loadOp.getTensorDescType();
+    if (auto storeOp = dyn_cast<xegpu::StoreNdOp>(op))
+      return storeOp.getTensorDescType();
+    if (auto updateOp = dyn_cast<xegpu::UpdateNdOffsetOp>(op))
+      return updateOp.getType();
+    if (auto prefetchOp = dyn_cast<xegpu::PrefetchNdOp>(op))
+      return prefetchOp.getTensorDescType();
+    return xegpu::TensorDescType();
+  };
+
+  auto isLegal = [&](xegpu::LayoutAttr layout) -> bool {
+    return !layout || layout.getSgLayout() == nullptr;
+  };
+
+  target.addDynamicallyLegalOp<xegpu::CreateNdDescOp, xegpu::LoadNdOp,
+                               xegpu::StoreNdOp, xegpu::UpdateNdOffsetOp,
+                               xegpu::PrefetchNdOp>([=](Operation *op) -> bool {
+    auto tdescTy = getTensorDescType(op);
+    auto layout = dyn_cast_or_null<xegpu::LayoutAttr>(tdescTy.getLayout());
+    return isLegal(layout);
+  });
+
+  target.addDynamicallyLegalOp<xegpu::DpasOp>([=](xegpu::DpasOp op) -> bool {
+    auto layout = dyn_cast_or_null<xegpu::LayoutAttr>(op->getAttr("layout"));
+    return isLegal(layout);
+  });
+
+  target.markUnknownOpDynamicallyLegal([](Operation *) { return true; });
+
+  xegpu::populateXeGPUWgToSgPatterns(patterns);
+  if (failed(
+          applyPartialConversion(getOperation(), target, std::move(patterns))))
+    return signalPassFailure();
+}
diff --git a/mlir/test/Dialect/XeGPU/xegpu-wg-to-sg-rr.mlir b/mlir/test/Dialect/XeGPU/xegpu-wg-to-sg-rr.mlir
new file mode 100644
index 0000000000000..de2c548ec7ebb
--- /dev/null
+++ b/mlir/test/Dialect/XeGPU/xegpu-wg-to-sg-rr.mlir
@@ -0,0 +1,66 @@
+// RUN: mlir-opt --xegpu-wg-to-sg -split-input-file %s | FileCheck %s
+
+gpu.module @test_round_robin_assignment {
+  // CHECK: test_create_nd_tdesc
+  // CHECK: %[[ARG_0:.*]]: memref<24x32xf32>
+  gpu.func @test_create_nd_tdesc(%src: memref<24x32xf32>) {
+      // CHECK-COUNT-12: %[[TDESC:.*]] = xegpu.create_nd_tdesc %[[ARG_...
[truncated]

@chencha3 chencha3 self-assigned this May 12, 2025
Comment on lines 85 to 93
for (size_t i = 0, j = 0; i != staticOffsets.size(); i++) {
if (ShapedType::isDynamic(staticOffsets[i]))
offsets.push_back(dynamicOffsets[j++]);
else
offsets.push_back(rewriter.create<arith::ConstantIndexOp>(
op.getLoc(), staticOffsets[i]));
}
return offsets;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

In PassUtils.h we have a getMixedAsValues for this.
For upstreaming, we could lift the version in MeshToMPI.cpp in upstream to a more prominent and re-usable place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

using getMixedOffsets now

Comment on lines 104 to 108
// Create a constant index value
Value createConstantIndex(ConversionPatternRewriter &rewriter, Location loc,
int64_t value) const {
return rewriter.create<arith::ConstantIndexOp>(loc, value);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

See createIndex in PassUtils.h.
In any case, shouldn't these helper functions be static?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this function..inlining it


// Delinearize the 1D subgroup id into 2d
SmallVector<Value> sgIds = delinearizeSubgroupId(
rewriter, loc, linearSgId, sgLayoutDim[0], sgLayoutDim[1]);
Copy link
Contributor

Choose a reason for hiding this comment

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

is layout.getSgLayout().size() > 1 guaranteed?

Copy link
Contributor Author

@nbpatel nbpatel May 15, 2025

Choose a reason for hiding this comment

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

yes, for this version, the plan is to support 2D, I will extend it to nD (& 1D) in a subsequent PR

Choose a reason for hiding this comment

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

yes, for this version, the plan is to support 2D, I will extend it to nD (& 1D) in a subsequent PR

can you please add this in the PR description

rewriter.createOrFold<index::MulOp>(loc, sgIds[i], sgDataDim[i]);
}

SmallVector<Value> originalOffsets = extractOffsets(rewriter, op);
Copy link
Contributor

Choose a reason for hiding this comment

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

same question of the static/dynamic offsets.

Copy link
Contributor

Choose a reason for hiding this comment

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

consider using computeElementwiseMul

newCreateNdOps.push_back(newCreateNdOp);
}

rewriter.replaceOpWithMultiple(op, {newCreateNdOps});
Copy link
Contributor

@fschlimb fschlimb May 14, 2025

Choose a reason for hiding this comment

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

Just for my understanding: where is the number of results determined (for the replaced op )?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean how many ops the current op will be decomposed into? The StaticTileOffsetRange will give return the offsets each subgroup has to work on...we just iterate over them

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes.
replaceOpWithMultiple requires that the number of results is the same as for to-be-replaced op . How does the original op know how many results this pass will produce? I don't see a type-convert or alike.

}

// Convert linear subgroup ID to 2D coordinates
// TODO: Delinearize for nD
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we could use delinearizeIndex helper from affine/Utils.h

Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this create a new dep to affine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried it and it introduces affine dialect in the IR...I dont think we want that

Copy link
Contributor

Choose a reason for hiding this comment

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

Nothing wrong with that if it's helpful. AFAIK, the delinearization just adds affine maps and affine.apply which is nice for readability and (imo) less error prone than composing all the IR math by hand.
If it works fine, I'd still suggest using it as it solves the nD generalization.

using OpConversionPattern<xegpu::CreateNdDescOp>::OpConversionPattern;

// Helper to extract mixed offsets into a Value array
SmallVector<Value> extractOffsets(ConversionPatternRewriter &rewriter,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use getMixedOffset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. Changed it

rewriter.createOrFold<index::MulOp>(loc, sgIds[i], sgDataDim[i]);
}

SmallVector<Value> originalOffsets = extractOffsets(rewriter, op);
Copy link
Contributor

Choose a reason for hiding this comment

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

consider using computeElementwiseMul

for (size_t i = 0; i < sgLayout.size(); i++) {
sgLayoutDim[i] = createConstantIndex(rewriter, loc, sgLayout[i]);
sgDataDim[i] = createConstantIndex(rewriter, loc, sgShape[i]);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it is a good idea to convert int into IndexConstant here. It may be clearer to define a mul(value, int) macro for convenience?

llvm::SmallVector<Value> operands({aVec, bVec});
Value tmpC;
if (op.getAcc()) {
tmpC = adaptor.getAcc()[i++];
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel the logic around C is not correct for oneToN cases, could you double check? (size_t i = 0 may need to be put inside the first loop)

tmpC = rewriter.create<xegpu::DpasOp>(
loc, resTy, operands,
llvm::ArrayRef<NamedAttribute>(
{"layout", originalLayout.dropSgLayoutAndData()}));
Copy link
Contributor

Choose a reason for hiding this comment

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

please follow the layout naming scheme in SubgroupDistributeion. The name for result is in form of layout_result_{idx}, and for operand is layout_operand_{idx}. can originalLayout.dropSgLayoutAndData() return nullptr here?

@nbpatel
Copy link
Contributor Author

nbpatel commented May 16, 2025

A more general question about the design here.

If I read it correctly, the whole distribution logic is currently driven purely by create_nd_tdesc distribution and the other ops just follow. In general all these ops (and tests) more or less expect to be accompanied by create_nd_tdesc because we don't support distributing tensor_desc coming from, for example, function args. However, this falls apart for dpas that operates on vectors highlighting the limitation of this approach. The distribution right now does nothing if it is just xegpu.dpas op on its own.

Since each op is self contained thanks to the layout attr, I'd expect each op to be distributed individually and by the end of the conversion unrealized_casts will cancel out and/or necessary layout conversions would be materialized. The latter probably being a todo for later.

Yes, you are right, the current design expects that the IR uses all the xegpu ops and not any one op in isolation and hence the other ops just follow. This is because these are the cases we have come across so far. But I agree with you that we might hit the cases you mentioned and I will decouple the distribution logic in subsequent PR from create_nd op for all the ops that operate on vectors . I think for ops like load/store/update/prefetch we can safely assume there is a corresponding create_nd. I addressed all of your other comments. Thanks.

@adam-smnk
Copy link
Contributor

Yes, you are right, the current design expects that the IR uses all the xegpu ops and not any one op in isolation and hence the other ops just follow. This is because these are the cases we have come across so far. > But I agree with you that we might hit the cases you mentioned and I will decouple the distribution logic in subsequent PR from create_nd op for all the ops that operate on vectors .

Fair enough. Could you document it somewhere or at least add TODOs? Or even add a (failing) test case for a standalone dpas as it does not behave as expected without create_nd.

I think for ops like load/store/update/prefetch we can safely assume there is a corresponding create_nd.

I'm not sure how that will behave when there are layout conversions. This assumption shouldn't be needed as all ops have necessary information for layout distribution AFAIK.
Anyway, we can iterate on these cases a bit later.

Copy link
Contributor

@adam-smnk adam-smnk left a comment

Choose a reason for hiding this comment

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

Looks pretty fine for the first version - let's take it for a spin and see how the whole lowering comes together
I haven't fully checked offset computations, I assume they're fine and leaving final word here for @chencha3

gpu.return
}

// CHECK-LABEL: test_dpas_with_no_create_nd_desc
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd add a small comment to explain what is (or rather not in this case) happening here

Copy link
Contributor

@chencha3 chencha3 left a comment

Choose a reason for hiding this comment

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

LGTM.

@chencha3 chencha3 merged commit 747620d into llvm:main May 20, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented May 20, 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/9903

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)
...
[6693/7805] Building CXX object tools/llvm-yaml-numeric-parser-fuzzer/CMakeFiles/llvm-yaml-numeric-parser-fuzzer.dir/yaml-numeric-parser-fuzzer.cpp.o
[6694/7805] Building CXX object tools/llvm-yaml-parser-fuzzer/CMakeFiles/llvm-yaml-parser-fuzzer.dir/yaml-parser-fuzzer.cpp.o
[6695/7805] Linking CXX executable bin/llvm-rc
[6696/7805] Linking CXX executable bin/llvm-readtapi
[6697/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/archive2yaml.cpp.o
[6698/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/coff2yaml.cpp.o
[6699/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/dwarf2yaml.cpp.o
[6700/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/obj2yaml.cpp.o
[6701/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/dxcontainer2yaml.cpp.o
[6702/7805] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/bin/c++ -fPIC -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 -Wno-unnecessary-virtual-specifier -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  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  -lpthread  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib && :
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x18a): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0xa): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x1f): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `(anonymous namespace)::WgToSgCreateNdOp::calculateGlobalOffsets(mlir::ConversionPatternRewriter&, mlir::Location, llvm::SmallVector<mlir::OpFoldResult, 6u> const&, llvm::SmallVector<mlir::Value, 6u> const&, llvm::SmallVector<long, 6u> const&, llvm::SmallVector<long, 6u> const&) const [clone .isra.407]':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x25c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x2a1): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x525): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x55e): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x770): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x7a4): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `(anonymous namespace)::WgToSgCreateNdOp::matchAndRewrite(mlir::xegpu::CreateNdDescOp, mlir::xegpu::CreateNdDescOpGenericAdaptor<llvm::ArrayRef<mlir::ValueRange> >, mlir::ConversionPatternRewriter&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xe13): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xe5d): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[6703/7805] Linking CXX executable bin/llvm-stress
[6704/7805] Generating ../../bin/llvm-windres
[6705/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/minidump2yaml.cpp.o
[6706/7805] Building CXX object tools/remarks-shlib/CMakeFiles/Remarks.dir/libremarks.cpp.o
[6707/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/macho2yaml.cpp.o
[6708/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/elf2yaml.cpp.o
[6709/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/offload2yaml.cpp.o
[6710/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/xcoff2yaml.cpp.o
[6711/7805] Linking CXX executable bin/llvm-symbolizer
[6712/7805] Linking CXX executable bin/llvm-strings
[6713/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/wasm2yaml.cpp.o
[6714/7805] Building CXX object tools/opt/CMakeFiles/obj.LLVMOptDriver.dir/optdriver.cpp.o
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Argument.h:18,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Function.h:25,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/InstrTypes.h:28,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/Analysis/CallGraph.h:48,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/tools/opt/optdriver.cpp:16:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Value.h: In static member function ‘static bool llvm::isa_impl<llvm::ConstantData, llvm::Value>::doit(const llvm::Value&)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Value.h:997:29: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     return Val.getValueID() >= Value::ConstantDataFirstVal &&
Step 7 (build cmake config) failure: build cmake config (failure)
...
[6693/7805] Building CXX object tools/llvm-yaml-numeric-parser-fuzzer/CMakeFiles/llvm-yaml-numeric-parser-fuzzer.dir/yaml-numeric-parser-fuzzer.cpp.o
[6694/7805] Building CXX object tools/llvm-yaml-parser-fuzzer/CMakeFiles/llvm-yaml-parser-fuzzer.dir/yaml-parser-fuzzer.cpp.o
[6695/7805] Linking CXX executable bin/llvm-rc
[6696/7805] Linking CXX executable bin/llvm-readtapi
[6697/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/archive2yaml.cpp.o
[6698/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/coff2yaml.cpp.o
[6699/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/dwarf2yaml.cpp.o
[6700/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/obj2yaml.cpp.o
[6701/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/dxcontainer2yaml.cpp.o
[6702/7805] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/bin/c++ -fPIC -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 -Wno-unnecessary-virtual-specifier -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  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  -lpthread  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib && :
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x18a): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0xa): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x1f): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `(anonymous namespace)::WgToSgCreateNdOp::calculateGlobalOffsets(mlir::ConversionPatternRewriter&, mlir::Location, llvm::SmallVector<mlir::OpFoldResult, 6u> const&, llvm::SmallVector<mlir::Value, 6u> const&, llvm::SmallVector<long, 6u> const&, llvm::SmallVector<long, 6u> const&) const [clone .isra.407]':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x25c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x2a1): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x525): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x55e): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x770): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.isra.407+0x7a4): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: In function `(anonymous namespace)::WgToSgCreateNdOp::matchAndRewrite(mlir::xegpu::CreateNdDescOp, mlir::xegpu::CreateNdDescOpGenericAdaptor<llvm::ArrayRef<mlir::ValueRange> >, mlir::ConversionPatternRewriter&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xe13): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xe5d): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[6703/7805] Linking CXX executable bin/llvm-stress
[6704/7805] Generating ../../bin/llvm-windres
[6705/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/minidump2yaml.cpp.o
[6706/7805] Building CXX object tools/remarks-shlib/CMakeFiles/Remarks.dir/libremarks.cpp.o
[6707/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/macho2yaml.cpp.o
[6708/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/elf2yaml.cpp.o
[6709/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/offload2yaml.cpp.o
[6710/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/xcoff2yaml.cpp.o
[6711/7805] Linking CXX executable bin/llvm-symbolizer
[6712/7805] Linking CXX executable bin/llvm-strings
[6713/7805] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/wasm2yaml.cpp.o
[6714/7805] Building CXX object tools/opt/CMakeFiles/obj.LLVMOptDriver.dir/optdriver.cpp.o
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Argument.h:18,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Function.h:25,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/InstrTypes.h:28,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/Analysis/CallGraph.h:48,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/tools/opt/optdriver.cpp:16:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Value.h: In static member function ‘static bool llvm::isa_impl<llvm::ConstantData, llvm::Value>::doit(const llvm::Value&)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/IR/Value.h:997:29: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     return Val.getValueID() >= Value::ConstantDataFirstVal &&

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 20, 2025

LLVM Buildbot has detected a new failure on builder mlir-nvidia running on mlir-nvidia while building mlir at step 6 "build-check-mlir-build-only".

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

Here is the relevant piece of the build log for the reference
Step 6 (build-check-mlir-build-only) failure: build (failure)
...
34.252 [61/11/5150] Linking CXX shared library lib/libMLIRCAPIConversion.so.21.0git
34.258 [60/11/5151] Creating library symlink lib/libMLIRCAPIConversion.so
34.294 [60/10/5152] Linking CXX shared library lib/libMLIRGPUTestPasses.so.21.0git
34.302 [59/10/5153] Creating library symlink lib/libMLIRGPUTestPasses.so
34.311 [59/9/5154] Linking CXX shared library lib/libMLIRTestPass.so.21.0git
34.317 [58/9/5155] Creating library symlink lib/libMLIRTestPass.so
34.880 [58/8/5156] Building CXX object tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o
35.422 [58/7/5157] Building CXX object tools/mlir/test/lib/Dialect/XeGPU/CMakeFiles/MLIRXeGPUTestPasses.dir/TestXeGPUTransforms.cpp.o
37.420 [58/6/5158] Building CXX object tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o
37.516 [57/6/5159] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/bin/clang++ -fPIC -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  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib && :
ld.lld: error: undefined symbol: mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const)
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), void mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::'lambda'(mlir::MLIRContext*)>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&))

ld.lld: error: undefined symbol: mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::index::IndexDialect* mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::'lambda'()>(long))

ld.lld: error: undefined symbol: mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::MulOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&))

ld.lld: error: undefined symbol: mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::MulOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&))

ld.lld: error: undefined symbol: mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::AddOp, mlir::Value const&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value const&, mlir::Value&))
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::AddOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&))

ld.lld: error: undefined symbol: mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::AddOp, mlir::Value const&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value const&, mlir::Value&))
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::AddOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&))

ld.lld: error: undefined symbol: mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::RemUOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&))

ld.lld: error: undefined symbol: mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)
>>> referenced by XeGPUWgToSgDistribute.cpp
>>>               tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o:(void mlir::OpBuilder::createOrFold<mlir::index::RemUOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&))

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 20, 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/9881

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)
...
[6234/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CoreEngine.cpp.o
[6235/7805] Building CXX object tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o
[6236/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerHelpers.cpp.o
[6237/7805] Building CXX object tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o
[6238/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
[6239/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExplodedGraph.cpp.o
[6240/7805] Building CXX object tools/mlir/test/lib/Dialect/XeGPU/CMakeFiles/MLIRXeGPUTestPasses.dir/TestXeGPUTransforms.cpp.o
[6241/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporterVisitors.cpp.o
[6242/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngine.cpp.o
[6243/7805] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/bin/c++ -fPIC -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 -Wno-unnecessary-virtual-specifier -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  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x1e8): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0xa): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x1f): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::calculateGlobalOffsets(mlir::ConversionPatternRewriter&, mlir::Location, llvm::SmallVector<mlir::OpFoldResult, 6u> const&, llvm::SmallVector<mlir::Value, 6u> const&, llvm::SmallVector<long, 6u> const&, llvm::SmallVector<long, 6u> const&) const [clone .constprop.0]':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x275): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x2ca): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x583): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x5d3): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x7de): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x82e): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::matchAndRewrite(mlir::xegpu::CreateNdDescOp, mlir::xegpu::CreateNdDescOpGenericAdaptor<llvm::ArrayRef<mlir::ValueRange> >, mlir::ConversionPatternRewriter&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc09): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc63): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[6244/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineObjC.cpp.o
[6245/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineC.cpp.o
[6246/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[6247/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/HTMLDiagnostics.cpp.o
[6248/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineCallAndReturn.cpp.o
[6249/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineCXX.cpp.o
[6250/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SimpleSValBuilder.cpp.o
[6251/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/PlistDiagnostics.cpp.o
[6252/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ProgramState.cpp.o
[6253/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SimpleConstraintManager.cpp.o
[6254/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SValBuilder.cpp.o
[6255/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Store.cpp.o
[6256/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/LoopUnrolling.cpp.o
[6257/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SarifDiagnostics.cpp.o
[6258/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/AssumeModeling.cpp.o
[6259/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Z3CrosscheckVisitor.cpp.o
[6260/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/BlockInCriticalSectionChecker.cpp.o
[6261/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/BasicObjCFoundationChecks.cpp.o
[6262/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/AnalyzerStatsChecker.cpp.o
[6263/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/TextDiagnostics.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[6234/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CoreEngine.cpp.o
[6235/7805] Building CXX object tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o
[6236/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerHelpers.cpp.o
[6237/7805] Building CXX object tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o
[6238/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
[6239/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExplodedGraph.cpp.o
[6240/7805] Building CXX object tools/mlir/test/lib/Dialect/XeGPU/CMakeFiles/MLIRXeGPUTestPasses.dir/TestXeGPUTransforms.cpp.o
[6241/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BugReporterVisitors.cpp.o
[6242/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngine.cpp.o
[6243/7805] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/bin/c++ -fPIC -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 -Wno-unnecessary-virtual-specifier -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  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x1e8): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0xa): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x1f): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::calculateGlobalOffsets(mlir::ConversionPatternRewriter&, mlir::Location, llvm::SmallVector<mlir::OpFoldResult, 6u> const&, llvm::SmallVector<mlir::Value, 6u> const&, llvm::SmallVector<long, 6u> const&, llvm::SmallVector<long, 6u> const&) const [clone .constprop.0]':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x275): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x2ca): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x583): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x5d3): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x7de): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x82e): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::matchAndRewrite(mlir::xegpu::CreateNdDescOp, mlir::xegpu::CreateNdDescOpGenericAdaptor<llvm::ArrayRef<mlir::ValueRange> >, mlir::ConversionPatternRewriter&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc09): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc63): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[6244/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineObjC.cpp.o
[6245/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineC.cpp.o
[6246/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[6247/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/HTMLDiagnostics.cpp.o
[6248/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineCallAndReturn.cpp.o
[6249/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineCXX.cpp.o
[6250/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SimpleSValBuilder.cpp.o
[6251/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/PlistDiagnostics.cpp.o
[6252/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ProgramState.cpp.o
[6253/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SimpleConstraintManager.cpp.o
[6254/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SValBuilder.cpp.o
[6255/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Store.cpp.o
[6256/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/LoopUnrolling.cpp.o
[6257/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/SarifDiagnostics.cpp.o
[6258/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/AssumeModeling.cpp.o
[6259/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Z3CrosscheckVisitor.cpp.o
[6260/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/BlockInCriticalSectionChecker.cpp.o
[6261/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/BasicObjCFoundationChecks.cpp.o
[6262/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/AnalyzerStatsChecker.cpp.o
[6263/7805] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/TextDiagnostics.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 20, 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/11090

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)
...
[6149/7805] Linking CXX shared library lib/libclangToolingASTDiff.so.21.0git
[6150/7805] Building CXX object tools/clang/lib/FrontendTool/CMakeFiles/obj.clangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[6151/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/CommentToXML.cpp.o
[6152/7805] Creating library symlink lib/libclangToolingASTDiff.so
[6153/7805] Building CXX object tools/clang/lib/Tooling/Transformer/CMakeFiles/obj.clangTransformer.dir/RangeSelector.cpp.o
[6154/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/FileIndexRecord.cpp.o
[6155/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/ExpandResponseFilesCompilationDatabase.cpp.o
[6156/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o
[6157/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexSymbol.cpp.o
[6158/7805] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/bin/c++ -fPIC -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 -Wno-unnecessary-virtual-specifier -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  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x208): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0x13): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x23): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::calculateGlobalOffsets(mlir::ConversionPatternRewriter&, mlir::Location, llvm::SmallVector<mlir::OpFoldResult, 6u> const&, llvm::SmallVector<mlir::Value, 6u> const&, llvm::SmallVector<long, 6u> const&, llvm::SmallVector<long, 6u> const&) const [clone .constprop.0]':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x29b): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x2f4): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x5a8): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x5f9): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x804): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x855): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::matchAndRewrite(mlir::xegpu::CreateNdDescOp, mlir::xegpu::CreateNdDescOpGenericAdaptor<llvm::ArrayRef<mlir::ValueRange> >, mlir::ConversionPatternRewriter&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc2d): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc8a): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[6159/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/DirectoryScanner.cpp.o
[6160/7805] Building CXX object tools/clang/lib/IndexSerialization/CMakeFiles/obj.clangIndexSerialization.dir/SerializablePathCollection.cpp.o
[6161/7805] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/FrontendActions.cpp.o
In file included from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/clang/lib/Frontend/Rewrite/FrontendActions.cpp:23:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-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]
  246 |   virtual bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
      |                ^~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/clang/include/clang/Serialization/ASTReader.h:307:8: note:   by ‘virtual bool clang::ChainedASTReaderListener::visitInputFile(llvm::StringRef, bool, bool, bool)’
  307 |   bool visitInputFile(StringRef Filename, bool isSystem,
      |        ^~~~~~~~~~~~~~
cc1plus: note: unrecognized command-line option ‘-Wno-unnecessary-virtual-specifier’ may have been intended to silence earlier diagnostics
[6162/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/FileList.cpp.o
[6163/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/USRGeneration.cpp.o
[6164/7805] Linking CXX shared library lib/libclangDirectoryWatcher.so.21.0git
[6165/7805] Building CXX object tools/clang/lib/Tooling/Syntax/CMakeFiles/obj.clangToolingSyntax.dir/Tokens.cpp.o
[6166/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/JSONCompilationDatabase.cpp.o
[6167/7805] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/InterfaceStubFunctionsConsumer.cpp.o
[6168/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/Refactoring.cpp.o
[6169/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/LocateToolCompilationDatabase.cpp.o
[6170/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/CompilationDatabase.cpp.o
Step 7 (build cmake config) failure: build cmake config (failure)
...
[6149/7805] Linking CXX shared library lib/libclangToolingASTDiff.so.21.0git
[6150/7805] Building CXX object tools/clang/lib/FrontendTool/CMakeFiles/obj.clangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[6151/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/CommentToXML.cpp.o
[6152/7805] Creating library symlink lib/libclangToolingASTDiff.so
[6153/7805] Building CXX object tools/clang/lib/Tooling/Transformer/CMakeFiles/obj.clangTransformer.dir/RangeSelector.cpp.o
[6154/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/FileIndexRecord.cpp.o
[6155/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/ExpandResponseFilesCompilationDatabase.cpp.o
[6156/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/AllTUsExecution.cpp.o
[6157/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/IndexSymbol.cpp.o
[6158/7805] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/bin/c++ -fPIC -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 -Wno-unnecessary-virtual-specifier -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  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x208): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0x13): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x23): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::calculateGlobalOffsets(mlir::ConversionPatternRewriter&, mlir::Location, llvm::SmallVector<mlir::OpFoldResult, 6u> const&, llvm::SmallVector<mlir::Value, 6u> const&, llvm::SmallVector<long, 6u> const&, llvm::SmallVector<long, 6u> const&) const [clone .constprop.0]':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x29b): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x2f4): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x5a8): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x5f9): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x804): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp22calculateGlobalOffsetsERN4mlir25ConversionPatternRewriterENS1_8LocationERKN4llvm11SmallVectorINS1_12OpFoldResultELj6EEERKNS6_INS1_5ValueELj6EEERKNS6_IlLj6EEESH_.constprop.0+0x855): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::matchAndRewrite(mlir::xegpu::CreateNdDescOp, mlir::xegpu::CreateNdDescOpGenericAdaptor<llvm::ArrayRef<mlir::ValueRange> >, mlir::ConversionPatternRewriter&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc2d): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xc8a): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
[6159/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/DirectoryScanner.cpp.o
[6160/7805] Building CXX object tools/clang/lib/IndexSerialization/CMakeFiles/obj.clangIndexSerialization.dir/SerializablePathCollection.cpp.o
[6161/7805] Building CXX object tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/FrontendActions.cpp.o
In file included from /home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/clang/lib/Frontend/Rewrite/FrontendActions.cpp:23:
/home/botworker/bbot/amdgpu-offload-ubuntu-22-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]
  246 |   virtual bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
      |                ^~~~~~~~~~~~~~
/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/llvm-project/clang/include/clang/Serialization/ASTReader.h:307:8: note:   by ‘virtual bool clang::ChainedASTReaderListener::visitInputFile(llvm::StringRef, bool, bool, bool)’
  307 |   bool visitInputFile(StringRef Filename, bool isSystem,
      |        ^~~~~~~~~~~~~~
cc1plus: note: unrecognized command-line option ‘-Wno-unnecessary-virtual-specifier’ may have been intended to silence earlier diagnostics
[6162/7805] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/FileList.cpp.o
[6163/7805] Building CXX object tools/clang/lib/Index/CMakeFiles/obj.clangIndex.dir/USRGeneration.cpp.o
[6164/7805] Linking CXX shared library lib/libclangDirectoryWatcher.so.21.0git
[6165/7805] Building CXX object tools/clang/lib/Tooling/Syntax/CMakeFiles/obj.clangToolingSyntax.dir/Tokens.cpp.o
[6166/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/JSONCompilationDatabase.cpp.o
[6167/7805] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/InterfaceStubFunctionsConsumer.cpp.o
[6168/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/Refactoring.cpp.o
[6169/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/LocateToolCompilationDatabase.cpp.o
[6170/7805] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/CompilationDatabase.cpp.o

@joker-eph
Copy link
Collaborator

Bot failures are legit, we should revert unless there is a quick fix that can be pushed right now.

jplehr added a commit that referenced this pull request May 20, 2025
jplehr added a commit that referenced this pull request May 20, 2025
@chencha3
Copy link
Contributor

Sorry about it. It is being fixed offline.

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 20, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-sharedlibs running on linaro-flang-aarch64-sharedlibs while building mlir at step 5 "build-unified-tree".

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

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
472.572 [1187/40/6379] Linking CXX shared library lib/libMLIRTransformPDLExtension.so.21.0git
472.607 [1187/39/6380] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/Indexing.cpp.o
472.607 [1187/38/6381] Linking CXX shared library lib/libMLIRTransformDialectTransforms.so.21.0git
472.610 [1187/37/6382] Linking CXX shared library lib/libMLIRTransformDialectIRDLExtension.so.21.0git
472.615 [1187/36/6383] Linking CXX shared library lib/libMLIRShapeTestPasses.so.21.0git
472.616 [1187/35/6384] Linking CXX shared library lib/libMLIRTransformDebugExtension.so.21.0git
472.637 [1187/34/6385] Linking CXX shared library lib/libMLIRCAPISPIRV.so.21.0git
472.640 [1187/33/6386] Linking CXX shared library lib/libMLIRVCIXToLLVMIRTranslation.so.21.0git
472.646 [1187/32/6387] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXIndexDataConsumer.cpp.o
472.647 [1187/31/6388] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/local/bin/c++ -fPIC -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  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x1b8): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x1c8): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0x10): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0x30): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x28): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `void mlir::OpBuilder::createOrFold<mlir::index::MulOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5MulOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5MulOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x3c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5MulOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5MulOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x40): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5MulOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5MulOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x6c): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `void mlir::OpBuilder::createOrFold<mlir::index::AddOp, mlir::Value const&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value const&, mlir::Value&)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRKNS_5ValueERS4_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRKNS_5ValueERS4_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x3c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRKNS_5ValueERS4_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRKNS_5ValueERS4_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x40): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRKNS_5ValueERS4_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRKNS_5ValueERS4_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x6c): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `void mlir::OpBuilder::createOrFold<mlir::index::RemUOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index6RemUOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index6RemUOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x3c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index6RemUOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index6RemUOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x40): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index6RemUOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index6RemUOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x6c): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `void mlir::OpBuilder::createOrFold<mlir::index::AddOp, mlir::Value&, mlir::Value&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&, mlir::Value&)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x3c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x40): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_[_ZN4mlir9OpBuilder12createOrFoldINS_5index5AddOpEJRNS_5ValueES5_EEEvRN4llvm15SmallVectorImplIS4_EENS_8LocationEDpOT0_]+0x6c): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
472.671 [1187/30/6389] Linking CXX shared library lib/libMLIRCAPITransformDialect.so.21.0git
472.678 [1187/29/6390] Linking CXX shared library lib/libMLIRTransformLoopExtension.so.21.0git
472.715 [1187/28/6391] Linking CXX executable bin/offload-arch
472.721 [1187/27/6392] Linking CXX shared library lib/libMLIRNVGPUTestPasses.so.21.0git
472.728 [1187/26/6393] Building CXX object tools/clang/tools/clang-installapi/CMakeFiles/clang-installapi.dir/ClangInstallAPI.cpp.o
472.734 [1187/25/6394] Linking CXX executable bin/clang-nvlink-wrapper
472.744 [1187/24/6395] Linking CXX shared library lib/libMLIRTargetLLVM.so.21.0git
472.753 [1187/23/6396] Linking CXX shared library lib/libMyExtensionCh3.so.21.0git
472.758 [1187/22/6397] Linking CXX shared library lib/libclangAnalysisFlowSensitive.so.21.0git
472.761 [1187/21/6398] Linking CXX shared library lib/libMLIRSPIRVConversion.so.21.0git
472.777 [1187/20/6399] Linking CXX shared library lib/libMLIRSPIRVTranslateRegistration.so.21.0git
472.802 [1187/19/6400] Linking CXX shared library lib/libMLIRFuncToLLVM.so.21.0git

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 20, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-latest-gcc running on linaro-flang-aarch64-latest-gcc while building mlir at step 5 "build-unified-tree".

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

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
620.500 [387/1/7024] Linking CXX shared library lib/libMLIRVectorToLLVMPass.so.21.0git
620.525 [386/1/7025] Creating library symlink lib/libMLIRVectorToLLVMPass.so
621.044 [385/1/7026] Linking CXX shared library lib/libMLIRVectorTransformOps.so.21.0git
621.076 [384/1/7027] Creating library symlink lib/libMLIRVectorTransformOps.so
621.104 [383/1/7028] Creating library symlink lib/libMLIRXeGPUDialect.so
621.338 [382/1/7029] Linking CXX shared library lib/libMLIRVectorToXeGPU.so.21.0git
621.352 [381/1/7030] Creating library symlink lib/libMLIRVectorToXeGPU.so
621.545 [380/1/7031] Linking CXX shared library lib/libMLIRXeGPUUtils.so.21.0git
621.571 [379/1/7032] Creating library symlink lib/libMLIRXeGPUUtils.so
621.969 [378/1/7033] Linking CXX shared library lib/libMLIRXeGPUTransforms.so.21.0git
FAILED: lib/libMLIRXeGPUTransforms.so.21.0git 
: && /usr/local/bin/c++ -fPIC -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-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wno-unnecessary-virtual-specifier -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 -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRXeGPUTransforms.so.21.0git -o lib/libMLIRXeGPUTransforms.so.21.0git tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUFoldAliasOps.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUSubgroupDistribute.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUUnroll.cpp.o tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib:"  lib/libMLIRXeGPUUtils.so.21.0git  lib/libMLIRVectorTransforms.so.21.0git  lib/libMLIRXeGPUDialect.so.21.0git  lib/libMLIRAffineUtils.so.21.0git  lib/libMLIRTransforms.so.21.0git  lib/libMLIRTransformUtils.so.21.0git  lib/libMLIRRewrite.so.21.0git  lib/libMLIRRewritePDL.so.21.0git  lib/libMLIRPDLToPDLInterp.so.21.0git  lib/libMLIRPass.so.21.0git  lib/libMLIRPDLInterpDialect.so.21.0git  lib/libMLIRPDLDialect.so.21.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.21.0git  lib/libMLIRGPUUtils.so.21.0git  lib/libMLIRGPUDialect.so.21.0git  lib/libMLIRDLTIDialect.so.21.0git  lib/libMLIRLinalgDialect.so.21.0git  lib/libMLIRBufferizationDialect.so.21.0git  lib/libMLIRParser.so.21.0git  lib/libMLIRBytecodeReader.so.21.0git  lib/libMLIRAsmParser.so.21.0git  lib/libMLIRSparseTensorDialect.so.21.0git  lib/libMLIRMathDialect.so.21.0git  lib/libMLIRMemRefUtils.so.21.0git  lib/libMLIRSubsetOpInterface.so.21.0git  lib/libMLIRVectorUtils.so.21.0git  lib/libMLIRAffineAnalysis.so.21.0git  lib/libMLIRSCFDialect.so.21.0git  lib/libMLIRControlFlowDialect.so.21.0git  lib/libMLIRFuncDialect.so.21.0git  lib/libMLIRVectorDialect.so.21.0git  lib/libMLIRMaskableOpInterface.so.21.0git  lib/libMLIRMaskingOpInterface.so.21.0git  lib/libMLIRTensorDialect.so.21.0git  lib/libMLIRAffineDialect.so.21.0git  lib/libMLIRMemRefDialect.so.21.0git  lib/libMLIRMemorySlotInterfaces.so.21.0git  lib/libMLIRArithUtils.so.21.0git  lib/libMLIRDialectUtils.so.21.0git  lib/libMLIRValueBoundsOpInterface.so.21.0git  lib/libMLIRAnalysis.so.21.0git  lib/libMLIRViewLikeInterface.so.21.0git  lib/libMLIRControlFlowInterfaces.so.21.0git  lib/libMLIRSideEffectInterfaces.so.21.0git  lib/libMLIRLoopLikeInterface.so.21.0git  lib/libMLIRFunctionInterfaces.so.21.0git  lib/libMLIRCallInterfaces.so.21.0git  lib/libMLIRPresburger.so.21.0git  lib/libMLIRDataLayoutInterfaces.so.21.0git  lib/libMLIRComplexDialect.so.21.0git  lib/libMLIRArithDialect.so.21.0git  lib/libMLIRInferIntRangeCommon.so.21.0git  lib/libMLIRShapedOpInterfaces.so.21.0git  lib/libMLIRInferIntRangeInterface.so.21.0git  lib/libMLIRUBDialect.so.21.0git  lib/libMLIRDialect.so.21.0git  lib/libMLIRInferTypeOpInterface.so.21.0git  lib/libMLIRCastInterfaces.so.21.0git  lib/libMLIRDestinationStyleOpInterface.so.21.0git  lib/libMLIRParallelCombiningOpInterface.so.21.0git  lib/libMLIRVectorInterfaces.so.21.0git  lib/libMLIRIR.so.21.0git  lib/libMLIRSupport.so.21.0git  lib/libLLVMSupport.so.21.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `mlir::xegpu::impl::XeGPUWgToSgDistributeBase<(anonymous namespace)::XeGPUWgToSgDistributePass>::getDependentDialects(mlir::DialectRegistry&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x1b8): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK4mlir5xegpu4impl25XeGPUWgToSgDistributeBaseIN12_GLOBAL__N_125XeGPUWgToSgDistributePassEE20getDependentDialectsERNS_15DialectRegistryE+0x1bc): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::_Function_handler<mlir::Dialect* (mlir::MLIRContext*), mlir::DialectRegistry::insert<mlir::index::IndexDialect>()::{lambda(mlir::MLIRContext*)#1}>::_M_invoke(std::_Any_data const&, mlir::MLIRContext*&&)':
XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_[_ZNSt17_Function_handlerIFPN4mlir7DialectEPNS0_11MLIRContextEEZNS0_15DialectRegistry6insertINS0_5index12IndexDialectEEEvvEUlS4_E_E9_M_invokeERKSt9_Any_dataOS4_]+0x2c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::IndexDialect, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > llvm::function_ref<std::unique_ptr<mlir::Dialect, std::default_delete<mlir::Dialect> > ()>::callback_fn<mlir::MLIRContext::getOrLoadDialect<mlir::index::IndexDialect>()::{lambda()#1}>(long)':
XeGPUWgToSgDistribute.cpp:(.text._ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l[_ZN4llvm12function_refIFSt10unique_ptrIN4mlir7DialectESt14default_deleteIS3_EEvEE11callback_fnIZNS2_11MLIRContext16getOrLoadDialectINS2_5index12IndexDialectEEEPT_vEUlvE_EES6_l]+0x28): undefined reference to `mlir::index::IndexDialect::IndexDialect(mlir::MLIRContext*)'
/usr/bin/ld: tools/mlir/lib/Dialect/XeGPU/Transforms/CMakeFiles/obj.MLIRXeGPUTransforms.dir/XeGPUWgToSgDistribute.cpp.o: in function `(anonymous namespace)::WgToSgCreateNdOp::matchAndRewrite(mlir::xegpu::CreateNdDescOp, mlir::xegpu::CreateNdDescOpGenericAdaptor<llvm::ArrayRef<mlir::ValueRange> >, mlir::ConversionPatternRewriter&) const':
XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xa2c): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xa30): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::MulOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xba4): undefined reference to `mlir::index::MulOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xd10): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0xf4c): undefined reference to `mlir::index::RemUOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0x112c): undefined reference to `mlir::index::AddOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::Value)'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0x1934): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0x1938): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::AddOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0x1940): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
/usr/bin/ld: XeGPUWgToSgDistribute.cpp:(.text._ZNK12_GLOBAL__N_116WgToSgCreateNdOp15matchAndRewriteEN4mlir5xegpu14CreateNdDescOpENS2_28CreateNdDescOpGenericAdaptorIN4llvm8ArrayRefINS1_10ValueRangeEEEEERNS1_25ConversionPatternRewriterE+0x1944): undefined reference to `mlir::detail::TypeIDResolver<mlir::index::RemUOp, void>::id'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

kostasalv pushed a commit to kostasalv/llvm-project that referenced this pull request May 21, 2025
This PR adds the XeGPU workgroup (wg) to subgroup (sg) pass. The wg to
sg pass transforms the xegpu wg level operations to subgroup operations
based on the sg_layout and sg_data attribute. The PR adds transformation
patterns for following Ops

1. CreateNdDesc
2. LoadNd
3. StoreNd
4. PrefetchNd
4. UpdateNdOffset
5. Dpas
kostasalv pushed a commit to kostasalv/llvm-project that referenced this pull request May 21, 2025
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.

8 participants