radeonsi/llvm: Fix initialization of SIMachineFunctionInfo
authorTom Stellard <thomas.stellard@amd.com>
Wed, 25 Apr 2012 13:03:21 +0000 (09:03 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 25 Apr 2012 13:02:16 +0000 (09:02 -0400)
SIMachineFunctionInfo needs to be initialized before any of the
AMDIL passes.

src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp

index 328589cc1437e05a0e79b66efe72bae3229b059f..b37c6edea15f0f76b9ef6207d586346d01b558a8 100644 (file)
@@ -130,6 +130,10 @@ AMDGPUPassConfig::addPreISel()
 }
 
 bool AMDGPUPassConfig::addInstSelector() {
+  const AMDILSubtarget &ST = TM->getSubtarget<AMDILSubtarget>();
+  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<AMDILSubtarget>();
 
-  if (ST.device()->getGeneration() == AMDILDeviceInfo::HD7XXX) {
-    PM.add(createSIInitMachineFunctionInfoPass(*TM));
-  }
-
   PM.add(createAMDGPUReorderPreloadInstructionsPass(*TM));
   if (ST.device()->getGeneration() <= AMDILDeviceInfo::HD6XXX) {
     PM.add(createR600LowerShaderInstructionsPass(*TM));