From 5ae8ffe4369a7ed8ca4c5b4304f7601254642a5f Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Tue, 12 Jul 2016 22:23:42 +0000 Subject: [PATCH] GlobalISel: freeze reserved regs after IRTranslator. We can freeze the registers after the MachineFrameInfo has been configured (by telling it about calls, inline asm, ...). This doesn't happen at all yet, but will be part of IR translation. Fixes -verify-machineinstrs assertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275221 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/GlobalISel/IRTranslator.cpp | 5 +++++ test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index f4f1906be81..b8a960cfac7 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -155,5 +155,10 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &MF) { } } } + + // Now that the MachineFrameInfo has been configured, no further changes to + // the reserved registers are possible. + MRI->freezeReservedRegs(MF); + return false; } diff --git a/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll b/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll index 2ce035e1dc0..7d416d9b0ad 100644 --- a/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll +++ b/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll @@ -1,4 +1,4 @@ -; RUN: llc -O0 -stop-after=irtranslator -global-isel %s -o - 2>&1 | FileCheck %s +; RUN: llc -O0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - 2>&1 | FileCheck %s ; REQUIRES: global-isel ; This file checks that the translation from llvm IR to generic MachineInstr ; is correct. -- 2.11.0