[llvm] 8723b95 - [WinEH] Fix the wrong alignment orientation during calculating EH frame.

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 17:48:00 PST 2019


Author: Wang, Pengfei
Date: 2019-11-15T09:42:38+08:00
New Revision: 8723b95cefa4f2a891c2b496dca79f1734cf1d1c

URL: https://github.com/llvm/llvm-project/commit/8723b95cefa4f2a891c2b496dca79f1734cf1d1c
DIFF: https://github.com/llvm/llvm-project/commit/8723b95cefa4f2a891c2b496dca79f1734cf1d1c.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

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 a8f9c43312ae..3374cd054a6e 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -1860,7 +1860,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 b3f9c32210f6..9aca63e703e3 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 %xmm8, 48
-; CHECK: vmovaps %xmm7, 64(%rsp)
-; CHECK: .seh_savexmm %xmm7, 64
-; CHECK: vmovaps %xmm6, 80(%rsp)
-; CHECK: .seh_savexmm %xmm6, 80
+; CHECK: vmovaps %xmm8, 32(%rsp)
+; CHECK: .seh_savexmm %xmm8, 32
+; CHECK: vmovaps %xmm7, 48(%rsp)
+; CHECK: .seh_savexmm %xmm7, 48
+; CHECK: vmovaps %xmm6, 64(%rsp)
+; CHECK: .seh_savexmm %xmm6, 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-commits mailing list