Expose more xforms to the opt utility
authorChris Lattner <sabre@nondot.org>
Thu, 18 Oct 2001 20:06:45 +0000 (20:06 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 18 Oct 2001 20:06:45 +0000 (20:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@900 91177308-0d34-0410-b5e6-96231b3b80d8

tools/opt/Makefile
tools/opt/opt.cpp

index 604e4766e15cc498c6744708a2964bbe15cee044..7998a29097bbb35fab585984b582113fe7cd31f7 100644 (file)
@@ -1,6 +1,6 @@
 LEVEL = ../..
 TOOLNAME = opt
-USEDLIBS = opt bcreader bcwriter asmwriter analysis vmcore support instrument
+USEDLIBS = opt bcreader bcwriter asmwriter analysis vmcore support instrument transforms
 
 include $(LEVEL)/Makefile.common
 
index 7563c397772571d097d7a814be2575e2987f741c..757194d89b179a76e18abb26e43932a0960ac654 100644 (file)
 #include "llvm/Optimizations/AllOpts.h"
 #include "llvm/Transforms/Instrumentation/TraceValues.h"
 #include "llvm/Transforms/PrintModulePass.h"
+#include "llvm/Transforms/ConstantMerge.h"
 #include <fstream>
 
 using namespace opt;
 
 enum Opts {
   // Basic optimizations
-  dce, constprop, inlining, strip, mstrip,
+  dce, constprop, inlining, mergecons, strip, mstrip,
 
   // Miscellaneous Transformations
   trace, tracem, print,
@@ -35,6 +36,7 @@ struct {
   { dce      , new opt::DeadCodeElimination() },
   { constprop, new opt::ConstantPropogation() }, 
   { inlining , new opt::MethodInlining() },
+  { mergecons, new ConstantMerge() },
   { strip    , new opt::SymbolStripping() },
   { mstrip   , new opt::FullSymbolStripping() },
   { indvars  , new opt::InductionVariableCannonicalize() },
@@ -55,6 +57,7 @@ cl::EnumList<enum Opts> OptimizationList(cl::NoFlags,
   clEnumVal(dce      , "Dead Code Elimination"),
   clEnumVal(constprop, "Simple Constant Propogation"),
  clEnumValN(inlining , "inline", "Method Integration"),
+  clEnumVal(mergecons, "Merge identical global constants"),
   clEnumVal(strip    , "Strip Symbols"),
   clEnumVal(mstrip   , "Strip Module Symbols"),
   clEnumVal(indvars  , "Simplify Induction Variables"),