aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/X86TargetMachine.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-12-11 21:26:47 +0000
committerMatthias Braun <matze@braunis.de>2014-12-11 21:26:47 +0000
commit7e37a5f52347f7bc9c09471e731e3209e0583a3d (patch)
tree6008db5b6412401a9d5775ce4acf26b8e90a10db /llvm/lib/Target/X86/X86TargetMachine.cpp
parentdf036085f0fcedf405e36622c203045e072e57fd (diff)
downloadllvm-7e37a5f52347f7bc9c09471e731e3209e0583a3d.zip
llvm-7e37a5f52347f7bc9c09471e731e3209e0583a3d.tar.gz
llvm-7e37a5f52347f7bc9c09471e731e3209e0583a3d.tar.bz2
[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/X86/X86TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/X86/X86TargetMachine.cpp32
1 files changed, 9 insertions, 23 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp
index 8802feb..ce18761 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.cpp
+++ b/llvm/lib/Target/X86/X86TargetMachine.cpp
@@ -154,9 +154,8 @@ public:
void addIRPasses() override;
bool addInstSelector() override;
bool addILPOpts() override;
- bool addPreRegAlloc() override;
- bool addPostRegAlloc() override;
- bool addPreEmitPass() override;
+ void addPostRegAlloc() override;
+ void addPreEmitPass() override;
};
} // namespace
@@ -188,32 +187,19 @@ bool X86PassConfig::addILPOpts() {
return true;
}
-bool X86PassConfig::addPreRegAlloc() {
- return false; // -print-machineinstr shouldn't print after this.
-}
-
-bool X86PassConfig::addPostRegAlloc() {
+void X86PassConfig::addPostRegAlloc() {
addPass(createX86FloatingPointStackifierPass());
- return true; // -print-machineinstr should print after this.
}
-bool X86PassConfig::addPreEmitPass() {
- bool ShouldPrint = false;
- if (getOptLevel() != CodeGenOpt::None && getX86Subtarget().hasSSE2()) {
- addPass(createExecutionDependencyFixPass(&X86::VR128RegClass));
- ShouldPrint = true;
- }
+void X86PassConfig::addPreEmitPass() {
+ if (getOptLevel() != CodeGenOpt::None && getX86Subtarget().hasSSE2())
+ addPass(createExecutionDependencyFixPass(&X86::VR128RegClass), false);
- if (UseVZeroUpper) {
- addPass(createX86IssueVZeroUpperPass());
- ShouldPrint = true;
- }
+ if (UseVZeroUpper)
+ addPass(createX86IssueVZeroUpperPass(), false);
if (getOptLevel() != CodeGenOpt::None) {
- addPass(createX86PadShortFunctions());
+ addPass(createX86PadShortFunctions(), false);
addPass(createX86FixupLEAs());
- ShouldPrint = true;
}
-
- return ShouldPrint;
}