[llvm-branch-commits] [llvm-branch] r70936 - in /llvm/branches/Apple/Dib/tools: llc/llc.cpp lli/lli.cpp

Bill Wendling isanbard at gmail.com
Mon May 4 16:10:45 PDT 2009


Author: void
Date: Mon May  4 18:10:44 2009
New Revision: 70936

URL: http://llvm.org/viewvc/llvm-project?rev=70936&view=rev
Log:
--- Merging r70934 into '.':
U    tools/lli/lli.cpp
U    tools/llc/llc.cpp

Default llc / lli optimization to "Default", which corresponds to -O1 / -O2.

Modified:
    llvm/branches/Apple/Dib/tools/llc/llc.cpp
    llvm/branches/Apple/Dib/tools/lli/lli.cpp

Modified: llvm/branches/Apple/Dib/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/tools/llc/llc.cpp?rev=70936&r1=70935&r2=70936&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/tools/llc/llc.cpp (original)
+++ llvm/branches/Apple/Dib/tools/llc/llc.cpp Mon May  4 18:10:44 2009
@@ -55,10 +55,11 @@
 
 static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
 
-// Determine optimization level. Level -O0 is equivalent to "fast" code gen.
+// Determine optimization level.
 static cl::opt<char>
 OptLevel("O",
-         cl::desc("Optimization level. [-O0, -O1, -O2, or -O3]"),
+         cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
+                  "(default = '-O2')"),
          cl::Prefix,
          cl::ZeroOrMore,
          cl::init(' '));
@@ -253,8 +254,7 @@
   raw_ostream *Out = GetOutputStream(argv[0]);
   if (Out == 0) return 1;
 
-  CodeGenOpt::Level OLvl = CodeGenOpt::Aggressive;
-
+  CodeGenOpt::Level OLvl = CodeGenOpt::Default;
   switch (OptLevel) {
   default:
     std::cerr << argv[0] << ": invalid optimization level.\n";

Modified: llvm/branches/Apple/Dib/tools/lli/lli.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/tools/lli/lli.cpp?rev=70936&r1=70935&r2=70936&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/tools/lli/lli.cpp (original)
+++ llvm/branches/Apple/Dib/tools/lli/lli.cpp Mon May  4 18:10:44 2009
@@ -43,10 +43,14 @@
                                  cl::desc("Force interpretation: disable JIT"),
                                  cl::init(false));
 
-  cl::opt<bool> Fast("fast", 
-                     cl::desc("Generate code quickly, "
-                              "potentially sacrificing code quality"),
-                     cl::init(false));
+  // Determine optimization level.
+  cl::opt<char>
+  OptLevel("O",
+           cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
+                    "(default = '-O2')"),
+           cl::Prefix,
+           cl::ZeroOrMore,
+           cl::init(' '));
 
   cl::opt<std::string>
   TargetTriple("mtriple", cl::desc("Override target triple for module"));
@@ -122,9 +126,19 @@
   if (!TargetTriple.empty())
     Mod->setTargetTriple(TargetTriple);
 
-  EE = ExecutionEngine::create(MP, ForceInterpreter, &ErrorMsg,
-                               Fast ?
-                                 CodeGenOpt::None : CodeGenOpt::Aggressive);
+  CodeGenOpt::Level OLvl = CodeGenOpt::Default;
+  switch (OptLevel) {
+  default:
+    std::cerr << argv[0] << ": invalid optimization level.\n";
+    return 1;
+  case ' ': break;
+  case '0': OLvl = CodeGenOpt::None; break;
+  case '1':
+  case '2': OLvl = CodeGenOpt::Default; break;
+  case '3': OLvl = CodeGenOpt::Aggressive; break;
+  }
+
+  EE = ExecutionEngine::create(MP, ForceInterpreter, &ErrorMsg, OLvl);
   if (!EE && !ErrorMsg.empty()) {
     std::cerr << argv[0] << ":error creating EE: " << ErrorMsg << "\n";
     exit(1);





More information about the llvm-branch-commits mailing list