diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp index e938135a4ec..73980f38b99 100644 --- a/lib/CodeGen/InlineSpiller.cpp +++ b/lib/CodeGen/InlineSpiller.cpp @@ -25,11 +25,15 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; +static cl::opt +VerifySpills("verify-spills", cl::desc("Verify after each spill/split")); + namespace { class InlineSpiller : public Spiller { MachineFunctionPass &pass_; @@ -337,6 +341,8 @@ void InlineSpiller::spill(LiveInterval *li, SmallVectorImpl &spillIs) { LiveRangeEdit edit(*li, newIntervals, spillIs); spill(edit); + if (VerifySpills) + mf_.verify(&pass_); } void InlineSpiller::spill(LiveRangeEdit &edit) {