diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp index bc4fea7dcf23f..080f3ca540f2a 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -715,6 +715,7 @@ bool RegBankSelect::assignRegisterBanks(MachineFunction &MF) { } bool RegBankSelect::checkFunctionIsLegal(MachineFunction &MF) const { +#ifndef NDEBUG if (!DisableGISelLegalityCheck) { if (const MachineInstr *MI = machineFunctionIsIllegal(MF)) { reportGISelFailure(MF, *TPC, *MORE, "gisel-regbankselect", @@ -722,7 +723,7 @@ bool RegBankSelect::checkFunctionIsLegal(MachineFunction &MF) const { return false; } } - +#endif return true; }