Skip to content

Commit ff9eee9

Browse files
allow types narrower than f64 and update bazel
1 parent 8544cfc commit ff9eee9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,11 @@ void mlir::configureGpuToROCDLConversionLegality(ConversionTarget &target) {
334334
target.addIllegalOp<LLVM::CosOp, LLVM::ExpOp, LLVM::Exp2Op, LLVM::FCeilOp,
335335
LLVM::FFloorOp, LLVM::FRemOp, LLVM::LogOp, LLVM::Log10Op,
336336
LLVM::Log2Op, LLVM::PowOp, LLVM::SinOp>();
337-
// These ops are legal for f32 type.
337+
// These ops are not legal for f64 type but are legal for narrower float
338+
// types.
338339
target.addDynamicallyLegalOp<LLVM::ExpOp, LLVM::LogOp>([](Operation *op) {
339340
return any_of(op->getOperandTypes(), [](Type type) {
340-
return isa<FloatType>(type) && type.getIntOrFloatBitWidth() == 32;
341+
return isa<FloatType>(type) && type.getIntOrFloatBitWidth() < 64;
341342
});
342343
});
343344
// TODO: Remove once we support replacing non-root ops.

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6004,6 +6004,7 @@ cc_library(
60046004
":LLVMCommonConversion",
60056005
":LLVMDialect",
60066006
":MathDialect",
6007+
":MathToLLVM",
60076008
":MathToROCDL",
60086009
":MemRefDialect",
60096010
":MemRefToLLVM",

0 commit comments

Comments
 (0)