forked from OSchip/llvm-project
[AArch64][GlobalISel] Fix fallbacks introduced in r336120 due to unselectable stores.
r336120 resulted in falling back to SelectionDAG more often due to the G_STORE MMOs not matching the vreg size. This fixes that by explicitly any-extending the value. llvm-svn: 336209
This commit is contained in:
parent
5a6ba018d7
commit
d912ffaba5
|
@ -155,9 +155,12 @@ struct OutgoingArgHandler : public CallLowering::ValueHandler {
|
|||
|
||||
void assignValueToAddress(unsigned ValVReg, unsigned Addr, uint64_t Size,
|
||||
MachinePointerInfo &MPO, CCValAssign &VA) override {
|
||||
if (VA.getLocInfo() == CCValAssign::LocInfo::AExt)
|
||||
if (VA.getLocInfo() == CCValAssign::LocInfo::AExt) {
|
||||
Size = VA.getLocVT().getSizeInBits() / 8;
|
||||
|
||||
ValVReg = MIRBuilder.buildAnyExt(LLT::scalar(Size * 8), ValVReg)
|
||||
->getOperand(0)
|
||||
.getReg();
|
||||
}
|
||||
auto MMO = MIRBuilder.getMF().getMachineMemOperand(
|
||||
MPO, MachineMemOperand::MOStore, Size, 0);
|
||||
MIRBuilder.buildStore(ValVReg, Addr, *MMO);
|
||||
|
|
|
@ -16,9 +16,12 @@ target triple = "aarch64-apple-ios9.0"
|
|||
; CHECK: $w0 = COPY [[ANSWER]]
|
||||
; CHECK: $d0 = COPY [[D_ONE]]
|
||||
; CHECK: $x1 = COPY [[TWELVE]]
|
||||
; CHECK: G_STORE [[THREE]](s8), {{%[0-9]+}}(p0) :: (store 8 into stack, align 0)
|
||||
; CHECK: G_STORE [[ONE]](s16), {{%[0-9]+}}(p0) :: (store 8 into stack + 8, align 0)
|
||||
; CHECK: G_STORE [[FOUR]](s32), {{%[0-9]+}}(p0) :: (store 8 into stack + 16, align 0)
|
||||
; CHECK: [[THREE_EXT:%[0-9]+]]:_(s64) = G_ANYEXT [[THREE]]
|
||||
; CHECK: G_STORE [[THREE_EXT]](s64), {{%[0-9]+}}(p0) :: (store 8 into stack, align 0)
|
||||
; CHECK: [[ONE_EXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ONE]]
|
||||
; CHECK: G_STORE [[ONE_EXT]](s64), {{%[0-9]+}}(p0) :: (store 8 into stack + 8, align 0)
|
||||
; CHECK: [[FOUR_EXT:%[0-9]+]]:_(s64) = G_ANYEXT [[FOUR]]
|
||||
; CHECK: G_STORE [[FOUR_EXT]](s64), {{%[0-9]+}}(p0) :: (store 8 into stack + 16, align 0)
|
||||
; CHECK: G_STORE [[F_ONE]](s32), {{%[0-9]+}}(p0) :: (store 4 into stack + 24, align 0)
|
||||
; CHECK: G_STORE [[TWO]](s64), {{%[0-9]+}}(p0) :: (store 8 into stack + 32, align 0)
|
||||
declare void @varargs(i32, double, i64, ...)
|
||||
|
|
|
@ -74,7 +74,8 @@ continue:
|
|||
; CHECK: [[SP:%[0-9]+]]:_(p0) = COPY $sp
|
||||
; CHECK: [[OFFSET:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
|
||||
; CHECK: [[SLOT:%[0-9]+]]:_(p0) = G_GEP [[SP]], [[OFFSET]](s64)
|
||||
; CHECK: G_STORE [[ANSWER]](s32), [[SLOT]]
|
||||
; CHECK: [[ANSWER_EXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ANSWER]]
|
||||
; CHECK: G_STORE [[ANSWER_EXT]](s64), [[SLOT]]
|
||||
|
||||
; CHECK: [[SP:%[0-9]+]]:_(p0) = COPY $sp
|
||||
; CHECK: [[OFFSET:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
|
||||
|
|
Loading…
Reference in New Issue