forked from OSchip/llvm-project
Default llc / lli optimization to "Default", which corresponds to -O1 / -O2.
llvm-svn: 70934
This commit is contained in:
parent
c298ccb998
commit
09bd0b1bd2
|
@ -55,10 +55,11 @@ OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
|
||||||
|
|
||||||
static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
|
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>
|
static cl::opt<char>
|
||||||
OptLevel("O",
|
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::Prefix,
|
||||||
cl::ZeroOrMore,
|
cl::ZeroOrMore,
|
||||||
cl::init(' '));
|
cl::init(' '));
|
||||||
|
@ -253,8 +254,7 @@ int main(int argc, char **argv) {
|
||||||
raw_ostream *Out = GetOutputStream(argv[0]);
|
raw_ostream *Out = GetOutputStream(argv[0]);
|
||||||
if (Out == 0) return 1;
|
if (Out == 0) return 1;
|
||||||
|
|
||||||
CodeGenOpt::Level OLvl = CodeGenOpt::Aggressive;
|
CodeGenOpt::Level OLvl = CodeGenOpt::Default;
|
||||||
|
|
||||||
switch (OptLevel) {
|
switch (OptLevel) {
|
||||||
default:
|
default:
|
||||||
std::cerr << argv[0] << ": invalid optimization level.\n";
|
std::cerr << argv[0] << ": invalid optimization level.\n";
|
||||||
|
|
|
@ -43,10 +43,14 @@ namespace {
|
||||||
cl::desc("Force interpretation: disable JIT"),
|
cl::desc("Force interpretation: disable JIT"),
|
||||||
cl::init(false));
|
cl::init(false));
|
||||||
|
|
||||||
cl::opt<bool> Fast("fast",
|
// Determine optimization level.
|
||||||
cl::desc("Generate code quickly, "
|
cl::opt<char>
|
||||||
"potentially sacrificing code quality"),
|
OptLevel("O",
|
||||||
cl::init(false));
|
cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
|
||||||
|
"(default = '-O2')"),
|
||||||
|
cl::Prefix,
|
||||||
|
cl::ZeroOrMore,
|
||||||
|
cl::init(' '));
|
||||||
|
|
||||||
cl::opt<std::string>
|
cl::opt<std::string>
|
||||||
TargetTriple("mtriple", cl::desc("Override target triple for module"));
|
TargetTriple("mtriple", cl::desc("Override target triple for module"));
|
||||||
|
@ -122,9 +126,19 @@ int main(int argc, char **argv, char * const *envp) {
|
||||||
if (!TargetTriple.empty())
|
if (!TargetTriple.empty())
|
||||||
Mod->setTargetTriple(TargetTriple);
|
Mod->setTargetTriple(TargetTriple);
|
||||||
|
|
||||||
EE = ExecutionEngine::create(MP, ForceInterpreter, &ErrorMsg,
|
CodeGenOpt::Level OLvl = CodeGenOpt::Default;
|
||||||
Fast ?
|
switch (OptLevel) {
|
||||||
CodeGenOpt::None : CodeGenOpt::Aggressive);
|
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()) {
|
if (!EE && !ErrorMsg.empty()) {
|
||||||
std::cerr << argv[0] << ":error creating EE: " << ErrorMsg << "\n";
|
std::cerr << argv[0] << ":error creating EE: " << ErrorMsg << "\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in New Issue