[Mlir-commits] [mlir] [mlir][xegpu] Fix seg-fault caused by setting a null attribute (PR #146002)

Igor Zamyatin llvmlistbot at llvm.org
Fri Jun 27 08:32:31 PDT 2025


================
@@ -376,10 +376,12 @@ struct WgToSgElementwiseOp : public ConversionPattern {
       // Copy all attributes, but update "layout_result_0" to drop
       // sgLayout/sgData
       for (auto attr : op->getAttrs()) {
-        if (auto layout = dyn_cast<xegpu::LayoutAttr>(attr.getValue()))
-          state.addAttribute(attr.getName(), layout.dropSgLayoutAndData());
-        else
+        if (auto layout = dyn_cast<xegpu::LayoutAttr>(attr.getValue())) {
+          if (auto newLayout = layout.dropSgLayoutAndData())
----------------
Garra1980 wrote:

Yeah, you're right, sorry for the noise

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


More information about the Mlir-commits mailing list