[Mlir-commits] [mlir] [MLIR][ROCDL] Add math.clampf -> rocdl.fmed3 conversion (PR #163259)
Keshav Vinayak Jha
llvmlistbot at llvm.org
Tue Oct 14 07:09:22 PDT 2025
================
@@ -118,27 +150,31 @@ void mlir::populateMathToROCDLConversionPatterns(
// worth creating a separate pass for it.
populateOpPatterns<arith::RemFOp>(converter, patterns, "__ocml_fmod_f32",
"__ocml_fmod_f64", "__ocml_fmod_f16");
+
+ addChipsetDependentPatterns(converter, patterns, chipset);
}
-namespace {
-struct ConvertMathToROCDLPass
- : public impl::ConvertMathToROCDLBase<ConvertMathToROCDLPass> {
- ConvertMathToROCDLPass() = default;
+struct ConvertMathToROCDLPass final
+ : impl::ConvertMathToROCDLBase<ConvertMathToROCDLPass> {
+ using impl::ConvertMathToROCDLBase<
+ ConvertMathToROCDLPass>::ConvertMathToROCDLBase;
+
void runOnOperation() override;
};
-} // namespace
void ConvertMathToROCDLPass::runOnOperation() {
auto m = getOperation();
MLIRContext *ctx = m.getContext();
+ FailureOr<amdgpu::Chipset> maybeChipset = amdgpu::Chipset::parse(chipset);
----------------
keshavvinayak01 wrote:
Done.
https://github.com/llvm/llvm-project/pull/163259
More information about the Mlir-commits
mailing list