[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.
This commit is contained in:
Nikita Popov 2023-11-01 12:22:56 +01:00
parent 885d2e4331
commit 3a2fbf547d

View File

@ -366,7 +366,7 @@ static Type *getReducedType(Value *V, Type *Ty) {
Value *TruncInstCombine::getReducedOperand(Value *V, Type *SclTy) {
Type *Ty = getReducedType(V, SclTy);
if (auto *C = dyn_cast<Constant>(V)) {
C = ConstantExpr::getIntegerCast(C, Ty, false);
C = ConstantExpr::getTrunc(C, Ty);
// If we got a constantexpr back, try to simplify it with DL info.
return ConstantFoldConstant(C, DL, &TLI);
}