diff options
author | Matthias Braun <matze@braunis.de> | 2014-12-11 21:26:47 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2014-12-11 21:26:47 +0000 |
commit | 7e37a5f52347f7bc9c09471e731e3209e0583a3d (patch) | |
tree | 6008db5b6412401a9d5775ce4acf26b8e90a10db /llvm/lib/Target/Mips/MipsTargetMachine.cpp | |
parent | df036085f0fcedf405e36622c203045e072e57fd (diff) | |
download | bcm5719-llvm-7e37a5f52347f7bc9c09471e731e3209e0583a3d.tar.gz bcm5719-llvm-7e37a5f52347f7bc9c09471e731e3209e0583a3d.zip |
[CodeGen] Add print and verify pass after each MachineFunctionPass by default
Previously print+verify passes were added in a very unsystematic way, which is
annoying when debugging as you miss intermediate steps and allows bugs to stay
unnotice when no verification is performed.
To make this change practical I added the possibility to explicitely disable
verification. I used this option on all places where no verification was
performed previously (because alot of places actually don't pass the
MachineVerifier).
In the long term these problems should be fixed properly and verification
enabled after each pass. I'll enable some more verification in subsequent
commits.
This is the 2nd attempt at this after realizing that PassManager::add() may
actually delete the pass.
llvm-svn: 224059
Diffstat (limited to 'llvm/lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index 33280e37a40..bee1cd062d7 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -170,9 +170,9 @@ public: void addIRPasses() override; bool addInstSelector() override; void addMachineSSAOptimization() override; - bool addPreEmitPass() override; + void addPreEmitPass() override; - bool addPreRegAlloc() override; + void addPreRegAlloc() override; }; } // namespace @@ -203,13 +203,9 @@ void MipsPassConfig::addMachineSSAOptimization() { TargetPassConfig::addMachineSSAOptimization(); } -bool MipsPassConfig::addPreRegAlloc() { - if (getOptLevel() == CodeGenOpt::None) { +void MipsPassConfig::addPreRegAlloc() { + if (getOptLevel() == CodeGenOpt::None) addPass(createMipsOptimizePICCallPass(getMipsTargetMachine())); - return true; - } - else - return false; } void MipsTargetMachine::addAnalysisPasses(PassManagerBase &PM) { @@ -228,10 +224,9 @@ void MipsTargetMachine::addAnalysisPasses(PassManagerBase &PM) { // Implemented by targets that want to run passes immediately before // machine code is emitted. return true if -print-machineinstrs should // print out the code after the passes. -bool MipsPassConfig::addPreEmitPass() { +void MipsPassConfig::addPreEmitPass() { MipsTargetMachine &TM = getMipsTargetMachine(); - addPass(createMipsDelaySlotFillerPass(TM)); - addPass(createMipsLongBranchPass(TM)); + addPass(createMipsDelaySlotFillerPass(TM), false); + addPass(createMipsLongBranchPass(TM), false); addPass(createMipsConstantIslandPass(TM)); - return true; } |