[Mlir-commits] [mlir] [mlir][ArithToAMDGPU] limit scaling truncf/extf support to gfx950 (PR #155431)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 4 10:26:56 PDT 2025


================
@@ -241,6 +242,9 @@ func.func @conversion_broadcast(%in: vector<4xf8E5M2>, %scale: f8E8M0FNU) -> vec
 
 // -----
 
+// CHECK-GFX1100-LABEL: @conversion_scalar
+// CHECK-GFX1100: arith.scaling_extf
----------------
Muzammiluddin-Syed-ECE wrote:

There does not exist support for scaled mxfp4 types in this target (gfx1100) so there is no viable legalization IIUC (cc @krzysz00 )

The main reason this change is necessary is to avoid running the scaled extf/truncf rewrite on unsupported chips when calling `populateArithToAMDGPUConversionPatterns` (See [here](https://github.com/iree-org/iree/blob/933f798046a817dcff48d84df8fd987c5cb9e72b/compiler/src/iree/compiler/Codegen/LLVMGPU/ConvertToROCDL.cpp#L244)). 

However, this check does not need to exist in `ArithToAMDGPU.cpp`. If preferred, I can create a separate function `populateConversionPatterns` in the same vein as how it's done in `Math/Transforms` where we use pass in a list of ops which we are interested in expanding, moving the check to the caller rather than having it here.

```
/// Adds patterns to expand math operations into other more fundamental
/// operations. For example, hyperbolic functions are expanded into expressions
/// using `exp`. If `opMnemonics` is empty then all available patterns will be
/// added, otherwise only the patterns corresponding to ops in `opMnemonics`
/// will be added to the set.
void populateExpansionPatterns(RewritePatternSet &patterns,
                               ArrayRef<StringRef> opMnemonics = {});
```

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


More information about the Mlir-commits mailing list