Skip to content

Commit 61af07c

Browse files
Added valid default value for chipset to pass
Signed-off-by: Keshav Vinayak Jha <[email protected]>
1 parent a9f2eff commit 61af07c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

mlir/include/mlir/Conversion/Passes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def ConvertMathToROCDL : Pass<"convert-math-to-rocdl", "ModuleOp"> {
790790
"vector::VectorDialect",
791791
];
792792
let options = [Option<"chipset", "chipset", "std::string",
793-
/*default=*/"\"\"",
793+
/*default=*/"\"gfx000\"",
794794
"Chipset that these operations will run on">];
795795
}
796796

mlir/lib/Conversion/MathToROCDL/MathToROCDL.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct ClampFOpConversion final
6262
opTy = vectorType.getElementType();
6363
}
6464

65-
if (!opTy.isF16() && !opTy.isF32()) {
65+
if (!isa<Float16Type, Float32Type>(opTy)) {
6666
return rewriter.notifyMatchFailure(
6767
op, "fmed3 only supports f16 and f32 types");
6868
}
@@ -74,9 +74,9 @@ struct ClampFOpConversion final
7474
op.getOperation(), adaptor.getOperands(), *getTypeConverter(),
7575
[&](Type llvm1DVectorTy, ValueRange operands) -> Value {
7676
typename math::ClampFOp::Adaptor adaptor(operands);
77-
return rewriter.create<ROCDL::FMed3Op>(
78-
op.getLoc(), llvm1DVectorTy, adaptor.getValue(),
79-
adaptor.getMin(), adaptor.getMax());
77+
return ROCDL::FMed3Op::create(rewriter, op.getLoc(), llvm1DVectorTy,
78+
adaptor.getValue(), adaptor.getMin(),
79+
adaptor.getMax());
8080
},
8181
rewriter);
8282
}
@@ -90,9 +90,9 @@ struct ClampFOpConversion final
9090
amdgpu::Chipset chipset;
9191
};
9292

93-
void addChipsetDependentPatterns(const LLVMTypeConverter &converter,
94-
RewritePatternSet &patterns,
95-
amdgpu::Chipset chipset) {
93+
static void addChipsetDependentPatterns(const LLVMTypeConverter &converter,
94+
RewritePatternSet &patterns,
95+
amdgpu::Chipset chipset) {
9696

9797
// V_MED3_F16/F32 only exists in gfx9+ architectures
9898
if (chipset.majorVersion >= 9) {

0 commit comments

Comments
 (0)