R600/SI: Adjsut SGPR live ranges before register allocation
[oota-llvm.git] / lib / Target / R600 / AMDGPUTargetMachine.cpp
index be1eceaaa00de1ff1f94b82598e95708f5cec417..8aab94446b5d4bb04d7266e6fb09eadb768a13e7 100644 (file)
@@ -174,6 +174,8 @@ bool AMDGPUPassConfig::addPreRegAlloc() {
     // SIFixSGPRCopies can generate a lot of duplicate instructions,
     // so we need to run MachineCSE afterwards.
     addPass(&MachineCSEID);
+    initializeSIFixSGPRLiveRangesPass(*PassRegistry::getPassRegistry());
+    insertPass(&RegisterCoalescerID, &SIFixSGPRLiveRangesID);
   }
   return false;
 }