summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-15 00:12:35 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-15 00:12:35 +0000
commit670ba46efe3c22e872e82f8196321d35f511a087 (patch)
treecb9a907dcb6758ec90869f245b5afaae327bad96 /llvm/lib/Target
parentb75233235c61eec5e11141a5a754fdfcb46c7fa8 (diff)
downloadbcm5719-llvm-670ba46efe3c22e872e82f8196321d35f511a087.tar.gz
bcm5719-llvm-670ba46efe3c22e872e82f8196321d35f511a087.zip
AMDGPU/SI: Update LiveIntervals during SIFixSGPRLiveRanges
Does not mark SlotIndexes as reserved, although I think that might be OK. LiveVariables still need to be handled. llvm-svn: 245133
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp b/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
index b469898bef5..b91649e54f9 100644
--- a/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
@@ -81,6 +81,10 @@ public:
AU.addRequired<LiveIntervals>();
AU.addRequired<MachinePostDominatorTree>();
AU.setPreservesCFG();
+
+ //AU.addPreserved<SlotIndexes>(); // XXX - This might be OK
+ AU.addPreserved<LiveIntervals>();
+
MachineFunctionPass::getAnalysisUsage(AU);
}
};
@@ -181,10 +185,15 @@ bool SIFixSGPRLiveRanges::runOnMachineFunction(MachineFunction &MF) {
// FIXME: Need to figure out how to update LiveRange here so this pass
// will be able to preserve LiveInterval analysis.
- BuildMI(*NCD, NCD->getFirstNonPHI(), DebugLoc(),
- TII->get(AMDGPU::SGPR_USE))
- .addReg(Reg, RegState::Implicit);
- DEBUG(NCD->getFirstNonPHI()->dump());
+ MachineInstr *NCDSGPRUse =
+ BuildMI(*NCD, NCD->getFirstNonPHI(), DebugLoc(),
+ TII->get(AMDGPU::SGPR_USE))
+ .addReg(Reg, RegState::Implicit);
+
+ SlotIndex SI = LIS->InsertMachineInstrInMaps(NCDSGPRUse);
+ LIS->extendToIndices(*LR, SI.getRegSlot());
+
+ DEBUG(NCDSGPRUse->dump());
}
}
OpenPOWER on IntegriCloud