GlobalISel: mark incoming landing-pad registers as live.

Should fix machine verifier failures.

llvm-svn: 293334
This commit is contained in:
Tim Northover 2017-01-27 21:31:17 +00:00
parent 78aacbe2f9
commit c9bc8a5580
2 changed files with 3 additions and 1 deletions

View File

@ -759,6 +759,7 @@ bool IRTranslator::translateLandingPad(const User &U,
SmallVector<unsigned, 2> Regs;
SmallVector<uint64_t, 2> 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);

View File

@ -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*