[llvm-branch-commits] [llvm] 3437c7f - [WinEH] Fix the wrong alignment orientation during calculating EH frame.
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Nov 17 17:06:04 PST 2019
Author: Wang, Pengfei
Date: 2019-11-18T09:03:17+08:00
New Revision: 3437c7fc4470afa42c4e727e13585c861ae1f116
URL: https://github.com/llvm/llvm-project/commit/3437c7fc4470afa42c4e727e13585c861ae1f116
DIFF: https://github.com/llvm/llvm-project/commit/3437c7fc4470afa42c4e727e13585c861ae1f116.diff
LOG: [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)
Added:
Modified:
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/test/CodeGen/X86/win64-funclet-savexmm.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 854156b2bc8e..75cd92b3adc1 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 62ddebb9a5a0..4c0979e9ec23 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
More information about the llvm-branch-commits
mailing list