Skip to content

Commit 3a2fbf5

Browse files
committed
[AggressiveInstCombine] Avoid use of ConstantExpr::getIntegerCast() (NFC)
This transform only deals in truncations, so use ConstantExpr::getTrunc() instead of ConstantExpr::getIntegerCast() to clarify what operation is being performed here.
1 parent 885d2e4 commit 3a2fbf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static Type *getReducedType(Value *V, Type *Ty) {
366366
Value *TruncInstCombine::getReducedOperand(Value *V, Type *SclTy) {
367367
Type *Ty = getReducedType(V, SclTy);
368368
if (auto *C = dyn_cast<Constant>(V)) {
369-
C = ConstantExpr::getIntegerCast(C, Ty, false);
369+
C = ConstantExpr::getTrunc(C, Ty);
370370
// If we got a constantexpr back, try to simplify it with DL info.
371371
return ConstantFoldConstant(C, DL, &TLI);
372372
}

0 commit comments

Comments
 (0)