mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224059 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user