From c9bc8a55809d831d8a54381bfdebc88b8a0ed38c Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Fri, 27 Jan 2017 21:31:17 +0000 Subject: [PATCH] GlobalISel: mark incoming landing-pad registers as live. Should fix machine verifier failures. llvm-svn: 293334 --- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 2 ++ llvm/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index 4a642f44cb3d..ce3e682f14e4 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/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/llvm/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll index 1e1cf2bd7cdc..7e32a25f1dd2 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll +++ b/llvm/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*