From 7097e83dab7af66b02408df656afeae014e46711 Mon Sep 17 00:00:00 2001 From: Amara Emerson Date: Sat, 16 Mar 2019 01:02:10 +0000 Subject: [PATCH] [GlobalISel] Make isel verification checks of vregs run under NDEBUG only. llvm-svn: 356309 --- llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 4434c7e208b7..bbba28e5d6d0 100644 --- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -89,10 +89,10 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { "instruction is not legal", *MI); return false; } -#endif // FIXME: We could introduce new blocks and will need to fix the outer loop. // Until then, keep track of the number of blocks to assert that we don't. const size_t NumBlocks = MF.size(); +#endif for (MachineBasicBlock *MBB : post_order(&MF)) { if (MBB->empty()) @@ -144,8 +144,6 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { } } - const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo(); - for (MachineBasicBlock &MBB : MF) { if (MBB.empty()) continue; @@ -177,6 +175,8 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { } } +#ifndef NDEBUG + const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo(); // Now that selection is complete, there are no more generic vregs. Verify // that the size of the now-constrained vreg is unchanged and that it has a // register class. @@ -215,7 +215,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { reportGISelFailure(MF, TPC, MORE, R); return false; } - +#endif auto &TLI = *MF.getSubtarget().getTargetLowering(); TLI.finalizeLowering(MF);