mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-25 03:30:37 +00:00
Added -print-emitted-asm to print out JIT generated asm to cerr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40123 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d485dc3d77
commit
8bd6035750
@ -306,17 +306,18 @@ public:
|
|||||||
|
|
||||||
/// addCodeEmitter - This pass should be overridden by the target to add a
|
/// addCodeEmitter - This pass should be overridden by the target to add a
|
||||||
/// code emitter, if supported. If this is not supported, 'true' should be
|
/// code emitter, if supported. If this is not supported, 'true' should be
|
||||||
/// returned.
|
/// returned. If DumpAsm is true, the generated assembly is printed to cerr.
|
||||||
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, bool DumpAsm,
|
||||||
MachineCodeEmitter &MCE) {
|
MachineCodeEmitter &MCE) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// addSimpleCodeEmitter - This pass should be overridden by the target to add
|
/// addSimpleCodeEmitter - This pass should be overridden by the target to add
|
||||||
/// a code emitter (without setting flags), if supported. If this is not
|
/// a code emitter (without setting flags), if supported. If this is not
|
||||||
/// supported, 'true' should be returned.
|
/// supported, 'true' should be returned. If DumpAsm is true, the generated
|
||||||
|
/// assembly is printed to cerr.
|
||||||
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,8 @@ static cl::opt<bool> PrintLSR("print-lsr-output", cl::Hidden,
|
|||||||
cl::desc("Print LLVM IR produced by the loop-reduce pass"));
|
cl::desc("Print LLVM IR produced by the loop-reduce pass"));
|
||||||
static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden,
|
static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden,
|
||||||
cl::desc("Print LLVM IR input to isel pass"));
|
cl::desc("Print LLVM IR input to isel pass"));
|
||||||
|
static cl::opt<bool> PrintEmittedAsm("print-emitted-asm", cl::Hidden,
|
||||||
|
cl::desc("Dump emitter generated instructions as assembly"));
|
||||||
|
|
||||||
FileModel::Model
|
FileModel::Model
|
||||||
LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
|
LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM,
|
||||||
@ -119,7 +121,7 @@ bool LLVMTargetMachine::addPassesToEmitFileFinish(FunctionPassManager &PM,
|
|||||||
MachineCodeEmitter *MCE,
|
MachineCodeEmitter *MCE,
|
||||||
bool Fast) {
|
bool Fast) {
|
||||||
if (MCE)
|
if (MCE)
|
||||||
addSimpleCodeEmitter(PM, Fast, *MCE);
|
addSimpleCodeEmitter(PM, Fast, PrintEmittedAsm, *MCE);
|
||||||
|
|
||||||
// Delete machine code for this function
|
// Delete machine code for this function
|
||||||
PM.add(createMachineCodeDeleter());
|
PM.add(createMachineCodeDeleter());
|
||||||
@ -196,7 +198,7 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM,
|
|||||||
if (addPreEmitPass(PM, Fast) && PrintMachineCode)
|
if (addPreEmitPass(PM, Fast) && PrintMachineCode)
|
||||||
PM.add(createMachineFunctionPrinterPass(cerr));
|
PM.add(createMachineFunctionPrinterPass(cerr));
|
||||||
|
|
||||||
addCodeEmitter(PM, Fast, MCE);
|
addCodeEmitter(PM, Fast, PrintEmittedAsm, MCE);
|
||||||
|
|
||||||
// Delete machine code for this function
|
// Delete machine code for this function
|
||||||
PM.add(createMachineCodeDeleter());
|
PM.add(createMachineCodeDeleter());
|
||||||
|
@ -143,18 +143,22 @@ bool ARMTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|||||||
|
|
||||||
|
|
||||||
bool ARMTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
bool ARMTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
// FIXME: Move this to TargetJITInfo!
|
// FIXME: Move this to TargetJITInfo!
|
||||||
setRelocationModel(Reloc::Static);
|
setRelocationModel(Reloc::Static);
|
||||||
|
|
||||||
// Machine code emitter pass for ARM.
|
// Machine code emitter pass for ARM.
|
||||||
PM.add(createARMCodeEmitterPass(*this, MCE));
|
PM.add(createARMCodeEmitterPass(*this, MCE));
|
||||||
|
if (DumpAsm)
|
||||||
|
PM.add(createARMCodePrinterPass(*cerr.stream(), *this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ARMTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
bool ARMTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
// Machine code emitter pass for ARM.
|
// Machine code emitter pass for ARM.
|
||||||
PM.add(createARMCodeEmitterPass(*this, MCE));
|
PM.add(createARMCodeEmitterPass(*this, MCE));
|
||||||
|
if (DumpAsm)
|
||||||
|
PM.add(createARMCodePrinterPass(*cerr.stream(), *this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ public:
|
|||||||
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
std::ostream &Out);
|
std::ostream &Out);
|
||||||
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ThumbTargetMachine - Thumb target machine.
|
/// ThumbTargetMachine - Thumb target machine.
|
||||||
|
@ -86,12 +86,14 @@ bool AlphaTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool AlphaTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
bool AlphaTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
PM.add(createAlphaCodeEmitterPass(*this, MCE));
|
PM.add(createAlphaCodeEmitterPass(*this, MCE));
|
||||||
|
if (DumpAsm)
|
||||||
|
PM.add(createAlphaCodePrinterPass(*cerr.stream(), *this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool AlphaTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM,
|
bool AlphaTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM,
|
||||||
bool Fast,
|
bool Fast, bool DumpAsm,
|
||||||
MachineCodeEmitter &MCE) {
|
MachineCodeEmitter &MCE) {
|
||||||
return addCodeEmitter(PM, Fast, MCE);
|
return addCodeEmitter(PM, Fast, DumpAsm, MCE);
|
||||||
}
|
}
|
||||||
|
@ -63,9 +63,9 @@ public:
|
|||||||
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
std::ostream &Out);
|
std::ostream &Out);
|
||||||
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
@ -137,7 +137,7 @@ bool PPCTargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool PPCTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
bool PPCTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
// The JIT should use the static relocation model in ppc32 mode, PIC in ppc64.
|
// The JIT should use the static relocation model in ppc32 mode, PIC in ppc64.
|
||||||
// FIXME: This should be moved to TargetJITInfo!!
|
// FIXME: This should be moved to TargetJITInfo!!
|
||||||
if (Subtarget.isPPC64()) {
|
if (Subtarget.isPPC64()) {
|
||||||
@ -155,12 +155,16 @@ bool PPCTargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
|||||||
|
|
||||||
// Machine code emitter pass for PowerPC.
|
// Machine code emitter pass for PowerPC.
|
||||||
PM.add(createPPCCodeEmitterPass(*this, MCE));
|
PM.add(createPPCCodeEmitterPass(*this, MCE));
|
||||||
|
if (DumpAsm)
|
||||||
|
PM.add(createPPCAsmPrinterPass(*cerr.stream(), *this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PPCTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
bool PPCTargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
// Machine code emitter pass for PowerPC.
|
// Machine code emitter pass for PowerPC.
|
||||||
PM.add(createPPCCodeEmitterPass(*this, MCE));
|
PM.add(createPPCCodeEmitterPass(*this, MCE));
|
||||||
|
if (DumpAsm)
|
||||||
|
PM.add(createPPCAsmPrinterPass(*cerr.stream(), *this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -70,9 +70,9 @@ public:
|
|||||||
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
std::ostream &Out);
|
std::ostream &Out);
|
||||||
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
virtual const bool getEnableTailMergeDefault() const;
|
virtual const bool getEnableTailMergeDefault() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ bool X86TargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool X86TargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
bool X86TargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
// FIXME: Move this to TargetJITInfo!
|
// FIXME: Move this to TargetJITInfo!
|
||||||
setRelocationModel(Reloc::Static);
|
setRelocationModel(Reloc::Static);
|
||||||
Subtarget.setPICStyle(PICStyle::None);
|
Subtarget.setPICStyle(PICStyle::None);
|
||||||
@ -180,11 +180,16 @@ bool X86TargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
|||||||
setCodeModel(CodeModel::Large);
|
setCodeModel(CodeModel::Large);
|
||||||
|
|
||||||
PM.add(createX86CodeEmitterPass(*this, MCE));
|
PM.add(createX86CodeEmitterPass(*this, MCE));
|
||||||
|
if (DumpAsm)
|
||||||
|
PM.add(createX86CodePrinterPass(*cerr.stream(), *this));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool X86TargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
bool X86TargetMachine::addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE) {
|
bool DumpAsm, MachineCodeEmitter &MCE) {
|
||||||
PM.add(createX86CodeEmitterPass(*this, MCE));
|
PM.add(createX86CodeEmitterPass(*this, MCE));
|
||||||
|
if (DumpAsm)
|
||||||
|
PM.add(createX86CodePrinterPass(*cerr.stream(), *this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -65,9 +65,9 @@ public:
|
|||||||
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
std::ostream &Out);
|
std::ostream &Out);
|
||||||
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast,
|
||||||
MachineCodeEmitter &MCE);
|
bool DumpAsm, MachineCodeEmitter &MCE);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// X86_32TargetMachine - X86 32-bit target machine.
|
/// X86_32TargetMachine - X86 32-bit target machine.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user