mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 07:34:06 +00:00
add a new bugpoint mode -llc-safe. This uses LLC for both halves of a
miscompilation. This is useful for working around GCC+CBE bugs or for handling programs that CBE doesn't support (e.g. inline asm) when searching for optimizer bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b324bd735f
commit
cd6f46e2ac
@ -28,7 +28,7 @@ namespace {
|
|||||||
// for miscompilation.
|
// for miscompilation.
|
||||||
//
|
//
|
||||||
enum OutputType {
|
enum OutputType {
|
||||||
AutoPick, RunLLI, RunJIT, RunLLC, RunCBE, CBE_bug
|
AutoPick, RunLLI, RunJIT, RunLLC, RunCBE, CBE_bug, LLC_Safe
|
||||||
};
|
};
|
||||||
|
|
||||||
cl::opt<double>
|
cl::opt<double>
|
||||||
@ -47,6 +47,7 @@ namespace {
|
|||||||
clEnumValN(RunLLC, "run-llc", "Compile with LLC"),
|
clEnumValN(RunLLC, "run-llc", "Compile with LLC"),
|
||||||
clEnumValN(RunCBE, "run-cbe", "Compile with CBE"),
|
clEnumValN(RunCBE, "run-cbe", "Compile with CBE"),
|
||||||
clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"),
|
clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"),
|
||||||
|
clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"),
|
||||||
clEnumValEnd),
|
clEnumValEnd),
|
||||||
cl::init(AutoPick));
|
cl::init(AutoPick));
|
||||||
|
|
||||||
@ -133,6 +134,10 @@ bool BugDriver::initializeExecutionEnvironment() {
|
|||||||
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
|
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
|
||||||
&ToolArgv);
|
&ToolArgv);
|
||||||
break;
|
break;
|
||||||
|
case LLC_Safe:
|
||||||
|
Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
|
||||||
|
&ToolArgv);
|
||||||
|
break;
|
||||||
case RunCBE:
|
case RunCBE:
|
||||||
case CBE_bug:
|
case CBE_bug:
|
||||||
Interpreter = AbstractInterpreter::createCBE(getToolName(), Message,
|
Interpreter = AbstractInterpreter::createCBE(getToolName(), Message,
|
||||||
@ -148,8 +153,9 @@ bool BugDriver::initializeExecutionEnvironment() {
|
|||||||
if (InterpreterSel == RunCBE) {
|
if (InterpreterSel == RunCBE) {
|
||||||
// We already created a CBE, reuse it.
|
// We already created a CBE, reuse it.
|
||||||
cbe = Interpreter;
|
cbe = Interpreter;
|
||||||
} else if (InterpreterSel == CBE_bug) {
|
} else if (InterpreterSel == CBE_bug || InterpreterSel == LLC_Safe) {
|
||||||
// We want to debug the CBE itself. Use LLC as the 'known-good' compiler.
|
// We want to debug the CBE itself or LLC is known-good. Use LLC as the
|
||||||
|
// 'known-good' compiler.
|
||||||
std::vector<std::string> ToolArgs;
|
std::vector<std::string> ToolArgs;
|
||||||
ToolArgs.push_back("--relocation-model=pic");
|
ToolArgs.push_back("--relocation-model=pic");
|
||||||
cbe = AbstractInterpreter::createLLC(getToolName(), Message, &ToolArgs);
|
cbe = AbstractInterpreter::createLLC(getToolName(), Message, &ToolArgs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user