Skip to content

Commit 186a5f9

Browse files
committed
check float cast
1 parent f3d28c4 commit 186a5f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,11 @@ struct FancyAddFLowering : public ConvertOpToLLVMPattern<arith::AddFOp> {
583583
auto parent = op->getParentOfType<ModuleOp>();
584584
if (!parent)
585585
return failure();
586+
auto floatTy = dyn_cast<FloatType>(op.getType());
587+
if (!floatTy)
588+
return failure();
586589
FailureOr<Operation *> adder =
587590
LLVM::lookupOrCreateApFloatAddFFn(rewriter, parent);
588-
auto floatTy = cast<FloatType>(op.getType());
589591

590592
// Cast operands to 64-bit integers.
591593
Location loc = op.getLoc();

0 commit comments

Comments
 (0)