Skip to content

Commit 16a595e

Browse files
committed
[Attributor] Avoid use of ConstantExpr::getFPTrunc() (NFC)
Use the constant folding API instead. For simplificity I'm using the DL-independent API here.
1 parent 25af06f commit 16a595e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/Attributor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ Value *AA::getWithType(Value &V, Type &Ty) {
330330
if (C->getType()->isIntegerTy() && Ty.isIntegerTy())
331331
return ConstantExpr::getTrunc(C, &Ty, /* OnlyIfReduced */ true);
332332
if (C->getType()->isFloatingPointTy() && Ty.isFloatingPointTy())
333-
return ConstantExpr::getFPTrunc(C, &Ty, /* OnlyIfReduced */ true);
333+
return ConstantFoldCastInstruction(Instruction::FPTrunc, C, &Ty);
334334
}
335335
}
336336
return nullptr;

0 commit comments

Comments
 (0)