[Mlir-commits] [mlir] [MLIR][ROCDL] Add math.clampf -> rocdl.fmed3 conversion (PR #163520)

Keshav Vinayak Jha llvmlistbot at llvm.org
Thu Oct 16 02:22:58 PDT 2025


================
@@ -135,10 +197,20 @@ void ConvertMathToROCDLPass::runOnOperation() {
   RewritePatternSet patterns(&getContext());
   LowerToLLVMOptions options(ctx, DataLayout(m));
   LLVMTypeConverter converter(ctx, options);
-  populateMathToROCDLConversionPatterns(converter, patterns);
+
+  FailureOr<amdgpu::Chipset> maybeChipset;
+  if (!chipset.empty()) {
+    maybeChipset = amdgpu::Chipset::parse(chipset);
+    if (failed(maybeChipset)) {
+      return signalPassFailure();
+    }
+  }
+  populateMathToROCDLConversionPatterns(converter, patterns, *maybeChipset);
----------------
keshavvinayak01 wrote:

This won't work, error: `incompatible operand types ('mlir::amdgpu::Chipset' and 'const nullopt_t')`

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


More information about the Mlir-commits mailing list