diff options
Diffstat (limited to 'src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp')
-rw-r--r-- | src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp b/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp index 6f15430bd53..62c04d60b00 100644 --- a/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp +++ b/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp @@ -73,17 +73,18 @@ bool AMDGPUTargetMachine::addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out, CodeGenFileType FileType, bool DisableVerify) { - // XXX: Hack here addPassesToEmitFile will fail, but this is Ok since we are - // only using it to access addPassesToGenerateCode() - bool fail = LLVMTargetMachine::addPassesToEmitFile(PM, Out, FileType, - DisableVerify); - assert(fail); const AMDGPUSubtarget &STM = getSubtarget<AMDGPUSubtarget>(); std::string gpu = STM.getDeviceName(); if (gpu == "SI") { - PM.add(createSICodeEmitterPass(Out)); + return LLVMTargetMachine::addPassesToEmitFile(PM, Out, FileType, + DisableVerify); } else if (Subtarget.device()->getGeneration() <= AMDGPUDeviceInfo::HD6XXX) { + // XXX: Hack here addPassesToEmitFile will fail, but this is Ok since we are + // only using it to access addPassesToGenerateCode() + bool fail = LLVMTargetMachine::addPassesToEmitFile(PM, Out, FileType, + DisableVerify); + assert(fail); PM.add(createR600CodeEmitterPass(Out)); } else { abort(); |