From: Tom Stellard Date: Wed, 25 Apr 2012 13:03:21 +0000 (-0400) Subject: radeonsi/llvm: Fix initialization of SIMachineFunctionInfo X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76940ba852a9b9a34a36afc4b1709d548e036f2a;p=mesa.git radeonsi/llvm: Fix initialization of SIMachineFunctionInfo SIMachineFunctionInfo needs to be initialized before any of the AMDIL passes. --- diff --git a/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp b/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp index 328589cc143..b37c6edea15 100644 --- a/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp +++ b/src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp @@ -130,6 +130,10 @@ AMDGPUPassConfig::addPreISel() } bool AMDGPUPassConfig::addInstSelector() { + const AMDILSubtarget &ST = TM->getSubtarget(); + if (ST.device()->getGeneration() == AMDILDeviceInfo::HD7XXX) { + PM.add(createSIInitMachineFunctionInfoPass(*TM)); + } PM.add(createAMDILBarrierDetect(*TM)); PM.add(createAMDILPrintfConvert(*TM)); PM.add(createAMDILInlinePass(*TM)); @@ -141,10 +145,6 @@ bool AMDGPUPassConfig::addInstSelector() { bool AMDGPUPassConfig::addPreRegAlloc() { const AMDILSubtarget &ST = TM->getSubtarget(); - if (ST.device()->getGeneration() == AMDILDeviceInfo::HD7XXX) { - PM.add(createSIInitMachineFunctionInfoPass(*TM)); - } - PM.add(createAMDGPUReorderPreloadInstructionsPass(*TM)); if (ST.device()->getGeneration() <= AMDILDeviceInfo::HD6XXX) { PM.add(createR600LowerShaderInstructionsPass(*TM));