diff options
author | Wang, Pengfei <pengfei.wang@intel.com> | 2019-11-14 15:12:07 +0800 |
---|---|---|
committer | Wang, Pengfei <pengfei.wang@intel.com> | 2019-11-18 09:03:17 +0800 |
commit | 3437c7fc4470afa42c4e727e13585c861ae1f116 (patch) | |
tree | 05cd9962a2d0bea8ecd3cd0f588b5c0574497f11 | |
parent | 8af4ee9ff003eba3dfe06d999bab047a9539c473 (diff) | |
download | llvm-3437c7fc4470afa42c4e727e13585c861ae1f116.zip llvm-3437c7fc4470afa42c4e727e13585c861ae1f116.tar.gz llvm-3437c7fc4470afa42c4e727e13585c861ae1f116.tar.bz2 |
[WinEH] Fix the wrong alignment orientation during calculating EH frame.
Summary: This is a bug fix for further issues in PR43585.
Reviewers: rnk, RKSimon, craig.topper, andrew.w.kaylor
Subscribers: hiraditya, llvm-commits, annita.zhang
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70224
(cherry picked from commit 8723b95cefa4f2a891c2b496dca79f1734cf1d1c)
-rw-r--r-- | llvm/lib/Target/X86/X86FrameLowering.cpp | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/win64-funclet-savexmm.ll | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index 854156b..75cd92b 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -1869,7 +1869,7 @@ int X86FrameLowering::getWin64EHFrameIndexRef(const MachineFunction &MF, return getFrameIndexReference(MF, FI, FrameReg); FrameReg = TRI->getStackRegister(); - return alignTo(MFI.getMaxCallFrameSize(), getStackAlignment()) + it->second; + return alignDown(MFI.getMaxCallFrameSize(), getStackAlignment()) + it->second; } int X86FrameLowering::getFrameIndexReferenceSP(const MachineFunction &MF, diff --git a/llvm/test/CodeGen/X86/win64-funclet-savexmm.ll b/llvm/test/CodeGen/X86/win64-funclet-savexmm.ll index 62ddebb..4c0979e 100644 --- a/llvm/test/CodeGen/X86/win64-funclet-savexmm.ll +++ b/llvm/test/CodeGen/X86/win64-funclet-savexmm.ll @@ -85,17 +85,17 @@ try.cont: ; preds = %catchret.dest, %inv ; CHECK: subq $88, %rsp ; CHECK: .seh_stackalloc 88 ; CHECK: leaq 112(%rdx), %rbp -; CHECK: vmovaps %xmm8, 48(%rsp) -; CHECK: .seh_savexmm 8, 48 -; CHECK: vmovaps %xmm7, 64(%rsp) -; CHECK: .seh_savexmm 7, 64 -; CHECK: vmovaps %xmm6, 80(%rsp) -; CHECK: .seh_savexmm 6, 80 +; CHECK: vmovaps %xmm8, 32(%rsp) +; CHECK: .seh_savexmm 8, 32 +; CHECK: vmovaps %xmm7, 48(%rsp) +; CHECK: .seh_savexmm 7, 48 +; CHECK: vmovaps %xmm6, 64(%rsp) +; CHECK: .seh_savexmm 6, 64 ; CHECK: .seh_endprologue ; CHECK: movl -{{[0-9]+}}(%rbp), %ecx -; CHECK: vmovaps 80(%rsp), %xmm6 -; CHECK: vmovaps 64(%rsp), %xmm7 -; CHECK: vmovaps 48(%rsp), %xmm8 +; CHECK: vmovaps 64(%rsp), %xmm6 +; CHECK: vmovaps 48(%rsp), %xmm7 +; CHECK: vmovaps 32(%rsp), %xmm8 ; CHECK: leaq .LBB0_1(%rip), %rax ; CHECK: addq $88, %rsp ; CHECK: popq %rbx |