[llvm-branch-commits] [llvm-branch] r355313 - Merging r355136:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Mar 4 04:56:31 PST 2019
Author: hans
Date: Mon Mar 4 04:56:31 2019
New Revision: 355313
URL: http://llvm.org/viewvc/llvm-project?rev=355313&view=rev
Log:
Merging r355136:
------------------------------------------------------------------------
r355136 | efriedma | 2019-02-28 21:38:45 +0100 (Thu, 28 Feb 2019) | 12 lines
[AArch64] [Windows] Don't skip constructing UnwindHelp.
In certain cases, the first non-frame-setup instruction in a function is
a branch. For example, it could be a cbz on an argument. Make sure we
correctly allocate the UnwindHelp, and find an appropriate register to
use to initialize it.
Fixes https://bugs.llvm.org/show_bug.cgi?id=40184
Differential Revision: https://reviews.llvm.org/D58752
------------------------------------------------------------------------
Added:
llvm/branches/release_80/test/CodeGen/AArch64/wineh-try-catch-cbz.ll
- copied unchanged from r355136, llvm/trunk/test/CodeGen/AArch64/wineh-try-catch-cbz.ll
Modified:
llvm/branches/release_80/ (props changed)
llvm/branches/release_80/lib/Target/AArch64/AArch64FrameLowering.cpp
llvm/branches/release_80/test/CodeGen/AArch64/wineh-try-catch.ll
Propchange: llvm/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 4 04:56:31 2019
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,351322,351325,351344-351345,351349,351351,351370,351381,351387,351421,351426,351436,351475,351485,351753-351754,351765,351910,351930,351932,352034,352204,352246,352374,352465,352555,352607-352608,352707,352714,352770,352886,352889,352892,352895,352908,352917,352935,352945,353015,353061,353082,353138,353141,353155,353213,353218,353304,353308,353334,353367,353374,353383,353463,353480,353489,353551,353733,353758,353809,353907,354034,354117,354128,354131,354144,354207,354497,354505,354733,354756,354764,355116-355117
+/llvm/trunk:155241,351322,351325,351344-351345,351349,351351,351370,351381,351387,351421,351426,351436,351475,351485,351753-351754,351765,351910,351930,351932,352034,352204,352246,352374,352465,352555,352607-352608,352707,352714,352770,352886,352889,352892,352895,352908,352917,352935,352945,353015,353061,353082,353138,353141,353155,353213,353218,353304,353308,353334,353367,353374,353383,353463,353480,353489,353551,353733,353758,353809,353907,354034,354117,354128,354131,354144,354207,354497,354505,354733,354756,354764,355116-355117,355136
Modified: llvm/branches/release_80/lib/Target/AArch64/AArch64FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/Target/AArch64/AArch64FrameLowering.cpp?rev=355313&r1=355312&r2=355313&view=diff
==============================================================================
--- llvm/branches/release_80/lib/Target/AArch64/AArch64FrameLowering.cpp (original)
+++ llvm/branches/release_80/lib/Target/AArch64/AArch64FrameLowering.cpp Mon Mar 4 04:56:31 2019
@@ -2108,9 +2108,6 @@ void AArch64FrameLowering::processFuncti
while (MBBI != MBB.end() && MBBI->getFlag(MachineInstr::FrameSetup))
++MBBI;
- if (MBBI->isTerminator())
- return;
-
// Create an UnwindHelp object.
int UnwindHelpFI =
MFI.CreateStackObject(/*size*/8, /*alignment*/16, false);
@@ -2118,8 +2115,10 @@ void AArch64FrameLowering::processFuncti
// We need to store -2 into the UnwindHelp object at the start of the
// function.
DebugLoc DL;
- RS->enterBasicBlock(MBB);
- unsigned DstReg = RS->scavengeRegister(&AArch64::GPR64RegClass, MBBI, 0);
+ RS->enterBasicBlockEnd(MBB);
+ RS->backward(std::prev(MBBI));
+ unsigned DstReg = RS->FindUnusedReg(&AArch64::GPR64commonRegClass);
+ assert(DstReg && "There must be a free register after frame setup");
BuildMI(MBB, MBBI, DL, TII.get(AArch64::MOVi64imm), DstReg).addImm(-2);
BuildMI(MBB, MBBI, DL, TII.get(AArch64::STURXi))
.addReg(DstReg, getKillRegState(true))
Modified: llvm/branches/release_80/test/CodeGen/AArch64/wineh-try-catch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/CodeGen/AArch64/wineh-try-catch.ll?rev=355313&r1=355312&r2=355313&view=diff
==============================================================================
--- llvm/branches/release_80/test/CodeGen/AArch64/wineh-try-catch.ll (original)
+++ llvm/branches/release_80/test/CodeGen/AArch64/wineh-try-catch.ll Mon Mar 4 04:56:31 2019
@@ -22,8 +22,8 @@
; CHECK: add x29, sp, #32
; CHECK: sub sp, sp, #624
; CHECK: mov x19, sp
-; CHECK: orr x1, xzr, #0xfffffffffffffffe
-; CHECK: stur x1, [x19]
+; CHECK: orr x0, xzr, #0xfffffffffffffffe
+; CHECK: stur x0, [x19]
; Now check that x is stored at fp - 20. We check that this is the same
; location accessed from the funclet to retrieve x.
More information about the llvm-branch-commits
mailing list