[llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp

Vikram Adve vadve at psmith.cs.uiuc.edu
Thu Sep 19 19:53:03 PDT 2002


Changes in directory llvm/lib/Target:

TargetMachine.cpp updated: 1.8 -> 1.9

---
Log message:

Add peephole optimization pass at the end of code generation.


---
Diffs of the changes:

Index: llvm/lib/Target/TargetMachine.cpp
diff -u llvm/lib/Target/TargetMachine.cpp:1.8 llvm/lib/Target/TargetMachine.cpp:1.9
--- llvm/lib/Target/TargetMachine.cpp:1.8	Mon Sep 16 10:39:03 2002
+++ llvm/lib/Target/TargetMachine.cpp	Thu Sep 19 19:52:43 2002
@@ -12,6 +12,7 @@
 #include "llvm/CodeGen/InstrSelection.h"
 #include "llvm/CodeGen/InstrScheduling.h"
 #include "llvm/CodeGen/RegisterAllocation.h"
+#include "llvm/CodeGen/PeepholeOpts.h"
 #include "llvm/CodeGen/MachineCodeForMethod.h"
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "llvm/Reoptimizer/Mapping/MappingInfo.h" 
@@ -32,6 +33,9 @@
 static cl::opt<bool> DisableSched("nosched",
                                   cl::desc("Disable local scheduling pass"));
 
+static cl::opt<bool> DisablePeephole("nopeephole",
+                                     cl::desc("Disable peephole optimization pass"));
+
 //---------------------------------------------------------------------------
 // class TargetMachine
 // 
@@ -132,12 +136,10 @@
 
   PM.add(getRegisterAllocator(*this));
 
-  //PM.add(new OptimizeLeafProcedures());
-  //PM.add(new DeleteFallThroughBranches());
-  //PM.add(new RemoveChainedBranches());    // should be folded with previous
-  //PM.add(new RemoveRedundantOps());       // operations with %g0, NOP, etc.
-
   PM.add(getPrologEpilogInsertionPass());
+
+  if (!DisablePeephole)
+    PM.add(createPeepholeOptsPass(*this));
 
   PM.add(MappingInfoForFunction(Out));  
 





More information about the llvm-commits mailing list