From: Tim Northover Date: Fri, 27 Jan 2017 21:31:17 +0000 (+0000) Subject: GlobalISel: mark incoming landing-pad registers as live. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5041a6cc2067fd6403289a230f11575730f03618;p=llvm 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 --- diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index 4a642f44cb3..ce3e682f14e 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -759,6 +759,7 @@ bool IRTranslator::translateLandingPad(const User &U, SmallVector Regs; SmallVector Offsets; if (unsigned Reg = TLI.getExceptionPointerRegister(PersonalityFn)) { + MBB.addLiveIn(Reg); unsigned VReg = MRI->createGenericVirtualRegister(Tys[0]); MIRBuilder.buildCopy(VReg, Reg); Regs.push_back(VReg); @@ -766,6 +767,7 @@ bool IRTranslator::translateLandingPad(const User &U, } if (unsigned Reg = TLI.getExceptionSelectorRegister(PersonalityFn)) { + MBB.addLiveIn(Reg); unsigned VReg = MRI->createGenericVirtualRegister(Tys[1]); MIRBuilder.buildCopy(VReg, Reg); Regs.push_back(VReg); diff --git a/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll b/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll index 1e1cf2bd7cd..7e32a25f1dd 100644 --- a/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll +++ b/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll @@ -1,4 +1,4 @@ -; RUN: llc -O0 -mtriple=aarch64-apple-ios -global-isel -stop-after=legalizer %s -o - | FileCheck %s +; RUN: llc -O0 -mtriple=aarch64-apple-ios -verify-machineinstrs -global-isel -stop-after=legalizer %s -o - | FileCheck %s @_ZTIi = external global i8*