mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
radeon/llvm: Add subtarget feature: DumpCode
With this feature enabled, the LLVM backend will dump the MachineIntrs prior to emitting code. The mesa env variable R600_DUMP_SHADERS will enable this feature in the backend.
This commit is contained in:
parent
2d75a1e25e
commit
ff10dbf35f
5 changed files with 9 additions and 6 deletions
|
|
@ -52,9 +52,6 @@ public:
|
|||
formatted_raw_ostream &Out,
|
||||
CodeGenFileType FileType,
|
||||
bool DisableVerify);
|
||||
public:
|
||||
void dumpCode() { mDump = true; }
|
||||
bool shouldDumpCode() const { return mDump; }
|
||||
};
|
||||
|
||||
} /* End namespace llvm */
|
||||
|
|
|
|||
|
|
@ -60,6 +60,11 @@ def FeatureDebug : SubtargetFeature<"debug",
|
|||
"CapsOverride[AMDILDeviceInfo::Debug]",
|
||||
"true",
|
||||
"Debug mode is enabled, so disable hardware accelerated address spaces.">;
|
||||
def FeatureDumpCode : SubtargetFeature <"DumpCode",
|
||||
"mDumpCode",
|
||||
"true",
|
||||
"Dump MachineInstrs in the CodeEmitter">;
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Register File, Calling Conv, Instruction Descriptions
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ namespace llvm {
|
|||
uint32_t mVersion;
|
||||
bool mIs64bit;
|
||||
bool mIs32on64bit;
|
||||
bool mDumpCode;
|
||||
public:
|
||||
AMDILSubtarget(llvm::StringRef TT, llvm::StringRef CPU, llvm::StringRef FS);
|
||||
virtual ~AMDILSubtarget();
|
||||
|
|
@ -67,6 +68,7 @@ namespace llvm {
|
|||
ParseSubtargetFeatures(
|
||||
llvm::StringRef CPU,
|
||||
llvm::StringRef FS);
|
||||
bool dumpCode() const { return mDumpCode; }
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -155,10 +155,8 @@ bool R600CodeEmitter::runOnMachineFunction(MachineFunction &MF) {
|
|||
} else {
|
||||
evergreenEncoding = true;
|
||||
}
|
||||
const AMDGPUTargetMachine *amdtm =
|
||||
static_cast<const AMDGPUTargetMachine *>(&MF.getTarget());
|
||||
|
||||
if (amdtm->shouldDumpCode()) {
|
||||
if (STM.dumpCode()) {
|
||||
MF.dump();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes,
|
|||
/* XXX: Use TargetMachine.Options in 3.0 */
|
||||
if (dump) {
|
||||
mod->dump();
|
||||
FS += ",DumpCode";
|
||||
}
|
||||
PassManager PM;
|
||||
PM.add(new TargetData(*AMDGPUTargetMachine.getTargetData()));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue