summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
diff options
context:
space:
mode:
authorDavid L. Jones <dlj@google.com>2016-11-08 22:03:23 +0000
committerDavid L. Jones <dlj@google.com>2016-11-08 22:03:23 +0000
commite09ae201f207c17a67d55500f64e63fc084e592f (patch)
tree736b0f807374f559756427fa6b8423abd96e5c24 /llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
parentb506466a8a9b609aad1c07289ca54d68b58bcfd9 (diff)
downloadbcm5719-llvm-e09ae201f207c17a67d55500f64e63fc084e592f.tar.gz
bcm5719-llvm-e09ae201f207c17a67d55500f64e63fc084e592f.zip
GlobalISel: make sure debugging variables are appropriately elided in release builds.
Summary: There are two variables here that break. This change constrains both of them to debug builds (via DEBUG() or #ifndef NDEBUG). Reviewers: bkramer, t.p.northover Subscribers: mehdi_amini, vkalintiris Differential Revision: https://reviews.llvm.org/D26421 llvm-svn: 286300
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
index bd6d7e09091..72e4a23bb40 100644
--- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
@@ -69,6 +69,8 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
// FIXME: freezeReservedRegs is now done in IRTranslator, but there are many
// other MF/MFI fields we need to initialize.
+ const MachineRegisterInfo &MRI = MF.getRegInfo();
+
#ifndef NDEBUG
// Check that our input is fully legal: we require the function to have the
// Legalized property, so it should be.
@@ -77,7 +79,6 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
// The RegBankSelected property is already checked in the verifier. Note
// that it has the same layering problem, but we only use inline methods so
// end up not needing to link against the GlobalISel library.
- const MachineRegisterInfo &MRI = MF.getRegInfo();
if (const LegalizerInfo *MLI = MF.getSubtarget().getLegalizerInfo())
for (const MachineBasicBlock &MBB : MF)
for (const MachineInstr &MI : MBB)
@@ -99,9 +100,10 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
bool ReachedBegin = false;
for (auto MII = std::prev(MBB->end()), Begin = MBB->begin();
!ReachedBegin;) {
+#ifndef NDEBUG
// Keep track of the insertion range for debug printing.
const auto AfterIt = std::next(MII);
-
+#endif
// Select this instruction.
MachineInstr &MI = *MII;
OpenPOWER on IntegriCloud