From 76940ba852a9b9a34a36afc4b1709d548e036f2a Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 25 Apr 2012 09:03:21 -0400 Subject: [PATCH] radeonsi/llvm: Fix initialization of SIMachineFunctionInfo SIMachineFunctionInfo needs to be initialized before any of the AMDIL passes. --- src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)); -- 2.30.2