mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106979 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
41c9c0ea32
commit
1495247f51
@ -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…
Reference in New Issue
Block a user