summaryrefslogtreecommitdiff
path: root/lib/Target/ARM
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-10-07 19:47:53 +0000
committerManman Ren <manman.ren@gmail.com>2013-10-07 19:47:53 +0000
commitfb92f4645968724d2095ef95a7034d7e20d39b3f (patch)
treeb7bd9c3c111dd3ec500bfecf292dbd551abacc74 /lib/Target/ARM
parent116189a997a71d0e63db64ef4c6c3906078d94cf (diff)
downloadllvm-fb92f4645968724d2095ef95a7034d7e20d39b3f.tar.gz
llvm-fb92f4645968724d2095ef95a7034d7e20d39b3f.tar.bz2
llvm-fb92f4645968724d2095ef95a7034d7e20d39b3f.tar.xz
Struct byval: use the correct alignment for loads generated to load
from struct byval to registers. We used to pass 0 which means the alignment of PtrVT. Even when the alignment of the struct is smaller than 4, the LOADs would have alignment of 4, and further optimizations could combine the LOADs into a ldm, which would cause crash. The fix is to pass the alignment of the struct byval. rdar://problem/15144402 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r--lib/Target/ARM/ARMISelLowering.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index c1ed4a6428..03ca1999b8 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -1570,7 +1570,8 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
SDValue AddArg = DAG.getNode(ISD::ADD, dl, PtrVT, Arg, Const);
SDValue Load = DAG.getLoad(PtrVT, dl, Chain, AddArg,
MachinePointerInfo(),
- false, false, false, 0);
+ false, false, false,
+ DAG.InferPtrAlignment(AddArg));
MemOpChains.push_back(Load.getValue(1));
RegsToPass.push_back(std::make_pair(j, Load));
}