mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-10 22:43:53 +00:00
minor cleanup to SROA: when lowering type unsafe accesses to
large integers, the first inserted value would always create an 'or X, 0'. Even though this is trivially zapped by instcombine, don't bother creating this pointless instruction. llvm-svn: 106979
This commit is contained in:
parent
c0f3393cf7
commit
d3a1ef7fea
@ -1655,7 +1655,12 @@ void SROA::RewriteLoadUserOfWholeAlloca(LoadInst *LI, AllocaInst *AI,
|
||||
SrcField = BinaryOperator::CreateShl(SrcField, ShiftVal, "", LI);
|
||||
}
|
||||
|
||||
ResultVal = BinaryOperator::CreateOr(SrcField, ResultVal, "", LI);
|
||||
// Don't create an 'or x, 0' on the first iteration.
|
||||
if (!isa<Constant>(ResultVal) ||
|
||||
!cast<Constant>(ResultVal)->isNullValue())
|
||||
ResultVal = BinaryOperator::CreateOr(SrcField, ResultVal, "", LI);
|
||||
else
|
||||
ResultVal = SrcField;
|
||||
}
|
||||
|
||||
// Handle tail padding by truncating the result
|
||||
|
Loading…
x
Reference in New Issue
Block a user