mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
[InstCombine] Don't explicitly invoke const folding in shift combine
InstCombine uses an IRBuilder that automatically performs target-dependent constant folding, so explicitly invoking it here is not necessary.
This commit is contained in:
parent
88c43a1ace
commit
d09c237c96
@ -612,14 +612,9 @@ static Value *getShiftedValue(Value *V, unsigned NumBits, bool isLeftShift,
|
||||
// We can always evaluate constants shifted.
|
||||
if (Constant *C = dyn_cast<Constant>(V)) {
|
||||
if (isLeftShift)
|
||||
V = IC.Builder.CreateShl(C, NumBits);
|
||||
return IC.Builder.CreateShl(C, NumBits);
|
||||
else
|
||||
V = IC.Builder.CreateLShr(C, NumBits);
|
||||
// If we got a constantexpr back, try to simplify it with TD info.
|
||||
// TODO: This is dubious, IRBuilder<TargetFolder> should already do this.
|
||||
if (auto *C = dyn_cast<Constant>(V))
|
||||
V = ConstantFoldConstant(C, DL, &IC.getTargetLibraryInfo());
|
||||
return V;
|
||||
return IC.Builder.CreateLShr(C, NumBits);
|
||||
}
|
||||
|
||||
Instruction *I = cast<Instruction>(V);
|
||||
|
Loading…
Reference in New Issue
Block a user