Skip to content

Commit

Permalink
[AggressiveInstCombine] Avoid use of ConstantExpr::getIntegerCast() (…
Browse files Browse the repository at this point in the history
…NFC)

This transform only deals in truncations, so use
ConstantExpr::getTrunc() instead of ConstantExpr::getIntegerCast()
to clarify what operation is being performed here.
  • Loading branch information
nikic authored and pull[bot] committed Feb 21, 2024
1 parent ce22f8c commit 6700000
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6700000

Please sign in to comment.