mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 17:29:19 +00:00
ExecutionEngine: honor optimization level
It was getting ignored after r144788. Also fix an accidental implicit cast from the OptLevel enum to an optional bool argument. MSVC warned on this, but gcc didn't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145633 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
00737bdb48
commit
d95e67dac0
@ -580,6 +580,7 @@ public:
|
||||
const SmallVectorImpl<std::string>& MAttrs,
|
||||
Reloc::Model RM,
|
||||
CodeModel::Model CM,
|
||||
CodeGenOpt::Level OL,
|
||||
std::string *Err);
|
||||
|
||||
ExecutionEngine *create();
|
||||
|
@ -420,7 +420,7 @@ ExecutionEngine *ExecutionEngine::create(Module *M,
|
||||
ExecutionEngine *ExecutionEngine::createJIT(Module *M,
|
||||
std::string *ErrorStr,
|
||||
JITMemoryManager *JMM,
|
||||
CodeGenOpt::Level OptLevel,
|
||||
CodeGenOpt::Level OL,
|
||||
bool GVsWithCode,
|
||||
Reloc::Model RM,
|
||||
CodeModel::Model CMM) {
|
||||
@ -437,10 +437,10 @@ ExecutionEngine *ExecutionEngine::createJIT(Module *M,
|
||||
SmallVector<std::string, 1> MAttrs;
|
||||
|
||||
TargetMachine *TM =
|
||||
EngineBuilder::selectTarget(M, MArch, MCPU, MAttrs, RM, CMM, ErrorStr);
|
||||
EngineBuilder::selectTarget(M, MArch, MCPU, MAttrs, RM, CMM, OL, ErrorStr);
|
||||
if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;
|
||||
|
||||
return ExecutionEngine::JITCtor(M, ErrorStr, JMM, OptLevel, GVsWithCode, TM);
|
||||
return ExecutionEngine::JITCtor(M, ErrorStr, JMM, OL, GVsWithCode, TM);
|
||||
}
|
||||
|
||||
ExecutionEngine *EngineBuilder::create() {
|
||||
@ -467,7 +467,7 @@ ExecutionEngine *EngineBuilder::create() {
|
||||
if (WhichEngine & EngineKind::JIT) {
|
||||
if (TargetMachine *TM = EngineBuilder::selectTarget(M, MArch, MCPU, MAttrs,
|
||||
RelocModel, CMModel,
|
||||
ErrorStr)) {
|
||||
OptLevel, ErrorStr)) {
|
||||
if (UseMCJIT && ExecutionEngine::MCJITCtor) {
|
||||
ExecutionEngine *EE =
|
||||
ExecutionEngine::MCJITCtor(M, ErrorStr, JMM, OptLevel,
|
||||
|
@ -288,7 +288,7 @@ JIT::JIT(Module *M, TargetMachine &tm, TargetJITInfo &tji,
|
||||
|
||||
// Turn the machine code intermediate representation into bytes in memory that
|
||||
// may be executed.
|
||||
if (TM.addPassesToEmitMachineCode(PM, *JCE, OptLevel)) {
|
||||
if (TM.addPassesToEmitMachineCode(PM, *JCE)) {
|
||||
report_fatal_error("Target does not support machine code emission!");
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ void JIT::addModule(Module *M) {
|
||||
|
||||
// Turn the machine code intermediate representation into bytes in memory
|
||||
// that may be executed.
|
||||
if (TM.addPassesToEmitMachineCode(PM, *JCE, CodeGenOpt::Default)) {
|
||||
if (TM.addPassesToEmitMachineCode(PM, *JCE)) {
|
||||
report_fatal_error("Target does not support machine code emission!");
|
||||
}
|
||||
|
||||
@ -372,7 +372,7 @@ bool JIT::removeModule(Module *M) {
|
||||
|
||||
// Turn the machine code intermediate representation into bytes in memory
|
||||
// that may be executed.
|
||||
if (TM.addPassesToEmitMachineCode(PM, *JCE, CodeGenOpt::Default)) {
|
||||
if (TM.addPassesToEmitMachineCode(PM, *JCE)) {
|
||||
report_fatal_error("Target does not support machine code emission!");
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
|
||||
const SmallVectorImpl<std::string>& MAttrs,
|
||||
Reloc::Model RM,
|
||||
CodeModel::Model CM,
|
||||
CodeGenOpt::Level OL,
|
||||
std::string *ErrorStr) {
|
||||
Triple TheTriple(Mod->getTargetTriple());
|
||||
if (TheTriple.getTriple().empty())
|
||||
@ -87,7 +88,7 @@ TargetMachine *EngineBuilder::selectTarget(Module *Mod,
|
||||
// Allocate a target...
|
||||
TargetMachine *Target = TheTarget->createTargetMachine(TheTriple.getTriple(),
|
||||
MCPU, FeaturesStr,
|
||||
RM, CM);
|
||||
RM, CM, OL);
|
||||
assert(Target && "Could not allocate target machine!");
|
||||
return Target;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user