From eeeaf52ab6918ce309ad5e14f1e226e5c1d2c9a9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 12 Feb 2002 17:17:33 +0000 Subject: [PATCH] Enable register promotion pass git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1740 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/opt/opt.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index ab2668daaeb..13a07748af8 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -24,6 +24,7 @@ #include "llvm/Transforms/Scalar/ConstantProp.h" #include "llvm/Transforms/Scalar/IndVarSimplify.h" #include "llvm/Transforms/Scalar/InstructionCombining.h" +#include "llvm/Transforms/Scalar/PromoteMemoryToRegister.h" #include "llvm/Transforms/Instrumentation/TraceValues.h" #include "Support/CommandLine.h" #include @@ -38,7 +39,7 @@ enum Opts { trace, tracem, print, raiseallocs, cleangcc, // More powerful optimizations - indvars, instcombine, sccp, adce, raise, + indvars, instcombine, sccp, adce, raise, mem2reg, // Interprocedural optimizations... globaldce, swapstructs, sortstructs, @@ -87,6 +88,8 @@ struct { { sccp , New }, { adce , New }, { raise , New }, + { mem2reg , newPromoteMemoryToRegister }, + { trace , New }, { tracem , New }, { print , NewPrintMethodPass }, @@ -120,6 +123,7 @@ cl::EnumList OptimizationList(cl::NoFlags, clEnumVal(instcombine, "Combine redundant instructions"), clEnumVal(sccp , "Sparse Conditional Constant Propogation"), clEnumVal(adce , "Agressive DCE"), + clEnumVal(mem2reg , "Promote alloca locations to registers"), clEnumVal(globaldce , "Remove unreachable globals"), clEnumVal(swapstructs, "Swap structure types around"),