[Mlir-commits] [mlir] [MLIR][ROCDL] Add math.clampf -> rocdl.fmed3 conversion (PR #163259)
Fabian Mora
llvmlistbot at llvm.org
Tue Oct 14 13:36:01 PDT 2025
================
@@ -135,10 +196,20 @@ void ConvertMathToROCDLPass::runOnOperation() {
RewritePatternSet patterns(&getContext());
LowerToLLVMOptions options(ctx, DataLayout(m));
LLVMTypeConverter converter(ctx, options);
- populateMathToROCDLConversionPatterns(converter, patterns);
+
+ // Only populate chipset-dependent patterns if chipset is specified
+ if (!chipset.empty()) {
+ FailureOr<amdgpu::Chipset> maybeChipset = amdgpu::Chipset::parse(chipset);
+ if (failed(maybeChipset)) {
+ return signalPassFailure();
+ }
+ populateMathToROCDLConversionPatterns(converter, patterns, *maybeChipset);
+ }
----------------
fabianmcg wrote:
This is wrong, the call to `populateMathToROCDLConversionPatterns` shouldn't be guarded by an if.
https://github.com/llvm/llvm-project/pull/163259
More information about the Mlir-commits
mailing list