Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 1b793ce

Browse files
TNorthoverahmedbougacha
authored andcommitted
GlobalISel: mark incoming landing-pad registers as live.
Should fix machine verifier failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293334 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 5041a6c)
1 parent 437fa86 commit 1b793ce

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,15 @@ bool IRTranslator::translateLandingPad(const User &U,
759759
SmallVector<unsigned, 2> Regs;
760760
SmallVector<uint64_t, 2> Offsets;
761761
if (unsigned Reg = TLI.getExceptionPointerRegister(PersonalityFn)) {
762+
MBB.addLiveIn(Reg);
762763
unsigned VReg = MRI->createGenericVirtualRegister(Tys[0]);
763764
MIRBuilder.buildCopy(VReg, Reg);
764765
Regs.push_back(VReg);
765766
Offsets.push_back(0);
766767
}
767768

768769
if (unsigned Reg = TLI.getExceptionSelectorRegister(PersonalityFn)) {
770+
MBB.addLiveIn(Reg);
769771
unsigned VReg = MRI->createGenericVirtualRegister(Tys[1]);
770772
MIRBuilder.buildCopy(VReg, Reg);
771773
Regs.push_back(VReg);

test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -O0 -mtriple=aarch64-apple-ios -global-isel -stop-after=legalizer %s -o - | FileCheck %s
1+
; RUN: llc -O0 -mtriple=aarch64-apple-ios -verify-machineinstrs -global-isel -stop-after=legalizer %s -o - | FileCheck %s
22

33
@_ZTIi = external global i8*
44

0 commit comments

Comments
 (0)