[Mlir-commits] [mlir] [mlir][XeGPU] Fix crash in getUArch for unsupported architectures (PR #179173)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Feb 4 04:51:40 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- mlir/include/mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
index 013f49b73..eec68706b 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
@@ -252,9 +252,8 @@ public:
     const uArch *targetuArch = xegpu::uArch::getUArch(chipStr.value());
     if (!targetuArch)
       return rewriter.notifyMatchFailure(
-          createNdOp,
-          "Unsupported target chip for transpose optimization. "
-          "Expecting pvc or bmg.");
+          createNdOp, "Unsupported target chip for transpose optimization. "
+                      "Expecting pvc or bmg.");
 
     auto convertType = tryOptimize(tdescTy, targetuArch);
     if (convertType == tdescTy)
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
index bd74d9c2c..a5942c657 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
@@ -601,7 +601,8 @@ void LayoutInfoPropagation::visitPrefetchNdOp(
 
     auto uArch = getUArch(getChipStr(prefetch).value_or(""));
     if (!uArch) {
-      prefetch.emitWarning("Missing target attribute, unable to assign layout.");
+      prefetch.emitWarning(
+          "Missing target attribute, unable to assign layout.");
       return;
     }
     const auto *uArchInstruction =
@@ -1263,7 +1264,8 @@ void LayoutInfoPropagation::visitCreateDescOp(
     return;
   auto uArch = getUArch(getChipStr(createDesc).value_or(""));
   if (!uArch) {
-    createDesc.emitWarning("Missing target attribute, unable to assign layout.");
+    createDesc.emitWarning(
+        "Missing target attribute, unable to assign layout.");
     return;
   }
   // For offset operand propagate 1D default layout.

``````````

</details>


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


More information about the Mlir-commits mailing list