[Mlir-commits] [mlir] [MLIR][ROCDL] Add math.clampf -> rocdl.fmed3 conversion (PR #163520)
Keshav Vinayak Jha
llvmlistbot at llvm.org
Thu Oct 16 02:25:00 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:
I added
```
if (chipset.has_value() && chipset->majorVersion >= 9) {
patterns.add<ClampFOpConversion>(converter);
} else {
LDBG() << "Chipset dependent patterns were not added";
}
```
Which should be a strong enough check.
https://github.com/llvm/llvm-project/pull/163520
More information about the Mlir-commits
mailing list