summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM64/ARM64FastISel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/ARM64/ARM64FastISel.cpp')
-rw-r--r--llvm/lib/Target/ARM64/ARM64FastISel.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64FastISel.cpp b/llvm/lib/Target/ARM64/ARM64FastISel.cpp
index 0d4001ebf67..f8b54d033f7 100644
--- a/llvm/lib/Target/ARM64/ARM64FastISel.cpp
+++ b/llvm/lib/Target/ARM64/ARM64FastISel.cpp
@@ -1250,10 +1250,16 @@ bool ARM64FastISel::ProcessCallArgs(SmallVectorImpl<Value *> &Args,
assert(VA.isMemLoc() && "Assuming store on stack.");
// Need to store on the stack.
+ unsigned ArgSize = VA.getLocVT().getSizeInBits() / 8;
+
+ unsigned BEAlign = 0;
+ if (ArgSize < 8 && !Subtarget->isLittleEndian())
+ BEAlign = 8 - ArgSize;
+
Address Addr;
Addr.setKind(Address::RegBase);
Addr.setReg(ARM64::SP);
- Addr.setOffset(VA.getLocMemOffset());
+ Addr.setOffset(VA.getLocMemOffset() + BEAlign);
if (!EmitStore(ArgVT, Arg, Addr))
return false;
OpenPOWER on IntegriCloud