[llvm-commits] CVS: llvm/lib/Target/X86/X86.h X86TargetMachine.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Nov 30 23:19:01 PST 2003
Changes in directory llvm/lib/Target/X86:
X86.h updated: 1.21 -> 1.22
X86TargetMachine.cpp updated: 1.37 -> 1.38
---
Log message:
Add an option to enable the SSA based peephole optimizer.
Eventually this pass will provide substantially better code in the interim between when we
have a crappy isel and nice isel. Unfortunately doing so requires fixing the backend to
actually SUPPORT all of the fancy addressing modes that we now generate, and writing a DCE
pass for machine code. Each of these is a fairly substantial job, so this will remain disabled
for the immediate future. :(
---
Diffs of the changes: (+13 -4)
Index: llvm/lib/Target/X86/X86.h
diff -u llvm/lib/Target/X86/X86.h:1.21 llvm/lib/Target/X86/X86.h:1.22
--- llvm/lib/Target/X86/X86.h:1.21 Tue Nov 11 16:41:33 2003
+++ llvm/lib/Target/X86/X86.h Sun Nov 30 23:18:30 2003
@@ -34,6 +34,11 @@
///
FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM);
+/// createX86SSAPeepholeOptimizerPass - Create a pass to perform SSA-based X86
+/// specific peephole optimizations.
+///
+FunctionPass *createX86SSAPeepholeOptimizerPass();
+
/// createX86PeepholeOptimizer - Create a pass to perform X86 specific peephole
/// optimizations.
///
Index: llvm/lib/Target/X86/X86TargetMachine.cpp
diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.37 llvm/lib/Target/X86/X86TargetMachine.cpp:1.38
--- llvm/lib/Target/X86/X86TargetMachine.cpp:1.37 Tue Nov 11 16:41:33 2003
+++ llvm/lib/Target/X86/X86TargetMachine.cpp Sun Nov 30 23:18:30 2003
@@ -29,6 +29,8 @@
cl::desc("Print generated machine code"));
cl::opt<bool> NoPatternISel("disable-pattern-isel", cl::init(true),
cl::desc("Use the 'simple' X86 instruction selector"));
+ cl::opt<bool> NoSSAPeephole("disable-ssa-peephole", cl::init(true),
+ cl::desc("Disable the ssa-based peephole optimizer (defaults to disabled)"));
}
// allocateX86TargetMachine - Allocate and return a subclass of TargetMachine
@@ -66,9 +68,9 @@
else
PM.add(createX86PatternInstructionSelector(*this));
- // TODO: optional optimizations go here
-
- // FIXME: Add SSA based peephole optimizer here.
+ // Run optional SSA-based machine code optimizations next...
+ if (!NoSSAPeephole)
+ PM.add(createX86SSAPeepholeOptimizerPass());
// Print the instruction selected machine code...
if (PrintCode)
@@ -117,7 +119,9 @@
else
PM.add(createX86PatternInstructionSelector(*this));
- // TODO: optional optimizations go here
+ // Run optional SSA-based machine code optimizations next...
+ if (!NoSSAPeephole)
+ PM.add(createX86SSAPeepholeOptimizerPass());
// FIXME: Add SSA based peephole optimizer here.
More information about the llvm-commits
mailing list