mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
ValueTracker can't assume that an alloca with no specified alignment
will get its preferred alignment. It has to be careful and cautiously assume it will just get the ABI alignment. This prevents instcombine from rounding up the alignment of a load/store without adjusting the alignment of the alloca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61934 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -416,7 +416,7 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
|
||||
unsigned Align = AI->getAlignment();
|
||||
if (Align == 0 && TD) {
|
||||
if (isa<AllocaInst>(AI))
|
||||
Align = TD->getPrefTypeAlignment(AI->getType()->getElementType());
|
||||
Align = TD->getABITypeAlignment(AI->getType()->getElementType());
|
||||
else if (isa<MallocInst>(AI)) {
|
||||
// Malloc returns maximally aligned memory.
|
||||
Align = TD->getABITypeAlignment(AI->getType()->getElementType());
|
||||
|
||||
Reference in New Issue
Block a user