summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-12-06 21:02:19 +0000
committerTim Northover <tnorthover@apple.com>2016-12-06 21:02:19 +0000
commit14ceb45fb491ea54a61efb9e32c7b1dc902fa009 (patch)
treee59351582a6ecdee95e1176d534a176dd122428a /llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
parent8bc7e4da516c7a8cd3f1067fadb9c52ee297f6f4 (diff)
downloadbcm5719-llvm-14ceb45fb491ea54a61efb9e32c7b1dc902fa009.tar.gz
bcm5719-llvm-14ceb45fb491ea54a61efb9e32c7b1dc902fa009.zip
GlobalISel: correctly handle small args via memory.
We were rounding size in bits down rather than up, leading to 0-sized slots for i1 (assert!) and bugs for other types not byte-aligned. llvm-svn: 288848
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/CallLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/CallLowering.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index 0cb14261405..7f17d346a72 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -127,7 +127,7 @@ bool CallLowering::handleAssignments(MachineIRBuilder &MIRBuilder,
else if (VA.isMemLoc()) {
unsigned Size = VA.getValVT() == MVT::iPTR
? DL.getPointerSize()
- : VA.getValVT().getSizeInBits() / 8;
+ : alignTo(VA.getValVT().getSizeInBits(), 8) / 8;
unsigned Offset = VA.getLocMemOffset();
MachinePointerInfo MPO;
unsigned StackAddr = Handler.getStackAddress(Size, Offset, MPO);
OpenPOWER on IntegriCloud