diff options
| author | Amara Emerson <aemerson@apple.com> | 2019-09-11 23:53:23 +0000 |
|---|---|---|
| committer | Amara Emerson <aemerson@apple.com> | 2019-09-11 23:53:23 +0000 |
| commit | 55d86f04c737a9f9791500d5758af17e73558229 (patch) | |
| tree | e3cb02fb22805a47243661d3a1423ef09f0f8094 /llvm/lib/CodeGen/GlobalISel | |
| parent | e297ad1bd964f112787624956a83388b29b85af4 (diff) | |
| download | bcm5719-llvm-55d86f04c737a9f9791500d5758af17e73558229.tar.gz bcm5719-llvm-55d86f04c737a9f9791500d5758af17e73558229.zip | |
[AArch64][GlobalISel] Fall back on attempts to allocate split types on the stack.
First we were asserting that the ValNo of a VA was the wrong value. It doesn't actually
make a difference for us in CallLowering but fix that anyway to silence the assert.
The bigger issue was that after fixing the assert we were generating invalid MIR
because the merging/unmerging of values split across multiple registers wasn't
also implemented for memory locs. This happens when we run out of registers and
have to pass the split types like i128 -> i64 x 2 on the stack. This is do-able, but
for now just fall back.
llvm-svn: 371693
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp index 04aa072bc31..ccbe56da04e 100644 --- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp @@ -243,8 +243,8 @@ bool CallLowering::handleAssignments(CCState &CCInfo, } Args[i].Regs.push_back(Reg); Args[i].Flags.push_back(Flags); - if (Handler.assignArg(i, NewVT, NewVT, CCValAssign::Full, Args[i], - Args[i].Flags[Part], CCInfo)) { + if (Handler.assignArg(i + Part, NewVT, NewVT, CCValAssign::Full, + Args[i], Args[i].Flags[Part], CCInfo)) { // Still couldn't assign this smaller part type for some reason. return false; } @@ -276,8 +276,8 @@ bool CallLowering::handleAssignments(CCState &CCInfo, } Args[i].Regs.push_back(Unmerge.getReg(PartIdx)); Args[i].Flags.push_back(Flags); - if (Handler.assignArg(i, NewVT, NewVT, CCValAssign::Full, Args[i], - Args[i].Flags[PartIdx], CCInfo)) + if (Handler.assignArg(i + PartIdx, NewVT, NewVT, CCValAssign::Full, + Args[i], Args[i].Flags[PartIdx], CCInfo)) return false; } } @@ -298,9 +298,9 @@ bool CallLowering::handleAssignments(CCState &CCInfo, // FIXME: Pack registers if we have more than one. Register ArgReg = Args[i].Regs[0]; + MVT OrigVT = MVT::getVT(Args[i].Ty); + MVT VAVT = VA.getValVT(); if (VA.isRegLoc()) { - MVT OrigVT = MVT::getVT(Args[i].Ty); - MVT VAVT = VA.getValVT(); if (Handler.isIncomingArgumentHandler() && VAVT != OrigVT) { if (VAVT.getSizeInBits() < OrigVT.getSizeInBits()) { // Expected to be multiple regs for a single incoming arg. @@ -355,6 +355,14 @@ bool CallLowering::handleAssignments(CCState &CCInfo, Handler.assignValueToReg(ArgReg, VA.getLocReg(), VA); } } else if (VA.isMemLoc()) { + // Don't currently support loading/storing a type that needs to be split + // to the stack. Should be easy, just not implemented yet. + if (Args[i].Regs.size() > 1) { + LLVM_DEBUG( + dbgs() + << "Load/store a split arg to/from the stack not implemented yet"); + return false; + } MVT VT = MVT::getVT(Args[i].Ty); unsigned Size = VT == MVT::iPTR ? DL.getPointerSize() : alignTo(VT.getSizeInBits(), 8) / 8; |

