summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-12-05 22:20:32 +0000
committerTim Northover <tnorthover@apple.com>2016-12-05 22:20:32 +0000
commitc0bd197c6b873e831096f5fbf5ef74e80f8d6b49 (patch)
tree298a374900b7055b93348ccdf376c18418845ce1 /llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
parentd6b42ee4046772919b35be22510edeafe5baac73 (diff)
downloadbcm5719-llvm-c0bd197c6b873e831096f5fbf5ef74e80f8d6b49.tar.gz
bcm5719-llvm-c0bd197c6b873e831096f5fbf5ef74e80f8d6b49.zip
GlobalISel: handle pointer arguments that get assigned to the stack.
llvm-svn: 288717
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/CallLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/CallLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index 0e37ee61f4f..0cb14261405 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -107,6 +107,7 @@ bool CallLowering::handleAssignments(MachineIRBuilder &MIRBuilder,
ValueHandler &Handler) const {
MachineFunction &MF = MIRBuilder.getMF();
const Function &F = *MF.getFunction();
+ const DataLayout &DL = F.getParent()->getDataLayout();
SmallVector<CCValAssign, 16> ArgLocs;
CCState CCInfo(F.getCallingConv(), F.isVarArg(), MF, ArgLocs, F.getContext());
@@ -124,7 +125,9 @@ bool CallLowering::handleAssignments(MachineIRBuilder &MIRBuilder,
if (VA.isRegLoc())
Handler.assignValueToReg(Args[i].Reg, VA.getLocReg(), VA);
else if (VA.isMemLoc()) {
- unsigned Size = VA.getValVT().getSizeInBits() / 8;
+ unsigned Size = VA.getValVT() == MVT::iPTR
+ ? DL.getPointerSize()
+ : VA.getValVT().getSizeInBits() / 8;
unsigned Offset = VA.getLocMemOffset();
MachinePointerInfo MPO;
unsigned StackAddr = Handler.getStackAddress(Size, Offset, MPO);
OpenPOWER on IntegriCloud