AMDGPU: Properly register passes
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 7 Oct 2015 00:42:53 +0000 (00:42 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 7 Oct 2015 00:42:53 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249495 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

index 9d86d653b3c1f931c0dee1dc3b71ff6b30b2b38a..16fff50398ea5e6199fac01fe8a202a8a134fcc0 100644 (file)
@@ -45,6 +45,8 @@ extern "C" void LLVMInitializeAMDGPUTarget() {
 
   PassRegistry *PR = PassRegistry::getPassRegistry();
   initializeSIFixSGPRLiveRangesPass(*PR);
+  initializeSIFixControlFlowLiveIntervalsPass(*PR);
+  initializeSILoadStoreOptimizerPass(*PR);
 }
 
 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
@@ -284,7 +286,6 @@ void GCNPassConfig::addPreRegAlloc() {
   // earlier passes might recompute live intervals.
   // TODO: handle CodeGenOpt::None; fast RA ignores spill weights set by the pass
   if (getOptLevel() > CodeGenOpt::None) {
-    initializeSIFixControlFlowLiveIntervalsPass(*PassRegistry::getPassRegistry());
     insertPass(&MachineSchedulerID, &SIFixControlFlowLiveIntervalsID);
   }
 
@@ -294,7 +295,6 @@ void GCNPassConfig::addPreRegAlloc() {
 
     // This should be run after scheduling, but before register allocation. It
     // also need extra copies to the address operand to be eliminated.
-    initializeSILoadStoreOptimizerPass(*PassRegistry::getPassRegistry());
     insertPass(&MachineSchedulerID, &SILoadStoreOptimizerID);
     insertPass(&MachineSchedulerID, &RegisterCoalescerID);
   }