diff options
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll | 9 |
2 files changed, 10 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); diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll b/llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll index 37221e37b67..5828d4246b1 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll +++ b/llvm/test/CodeGen/AArch64/GlobalISel/call-translator.ll @@ -182,3 +182,12 @@ define void @test_call_stack() { call void @test_stack_slots([8 x i64] undef, i64 42, i64 12, i64* null) ret void } + +; CHECK-LABEL: name: test_mem_i1 +; CHECK: fixedStack: +; CHECK-NEXT: - { id: [[SLOT:[0-9]+]], offset: 0, size: 1, alignment: 16, isImmutable: true, isAliased: false } +; CHECK: [[ADDR:%[0-9]+]](p0) = G_FRAME_INDEX %fixed-stack.[[SLOT]] +; CHECK: {{%[0-9]+}}(s1) = G_LOAD [[ADDR]](p0) :: (invariant load 1 from %fixed-stack.[[SLOT]], align 0) +define void @test_mem_i1([8 x i64], i1 %in) { + ret void +} |