mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 20:20:54 +00:00
[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:
parent
885d2e4331
commit
3a2fbf547d
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user