summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-15 02:58:49 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-15 02:58:49 +0000
commit588732bd6ed9a5af18222d3435401e0d666bf45b (patch)
tree364ed5f74749c6f693ee2f32268610637f33c9ac /llvm/lib/Target
parent0bc0eef71c09ddc0c7ef73a0dc54a7875c965c03 (diff)
downloadbcm5719-llvm-588732bd6ed9a5af18222d3435401e0d666bf45b.tar.gz
bcm5719-llvm-588732bd6ed9a5af18222d3435401e0d666bf45b.zip
AMDGPU/SI: Only look at live out SGPR defs
When trying to fix SGPR live ranges, skip defs that are killed in the same block as the def. I don't think we need to worry about these cases as long as the live ranges of the SGPRs in dominating blocks are correct. This reduces the number of elements the second loop over the function needs to look at, and makes it generally easier to understand. The second loop also only considers if the live range is live in to a block, which logically means it must have been live out from another. llvm-svn: 245150
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp b/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
index 016e2c8c886..3dda827b671 100644
--- a/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
@@ -128,9 +128,13 @@ bool SIFixSGPRLiveRanges::runOnMachineFunction(MachineFunction &MF) {
continue;
unsigned Def = MO.getReg();
if (TargetRegisterInfo::isVirtualRegister(Def)) {
- if (TRI->isSGPRClass(MRI.getRegClass(Def)))
- SGPRLiveRanges.push_back(
- std::make_pair(Def, &LIS->getInterval(Def)));
+ if (TRI->isSGPRClass(MRI.getRegClass(Def))) {
+ // Only consider defs that are live outs. We don't care about def /
+ // use within the same block.
+ LiveRange &LR = LIS->getInterval(Def);
+ if (LIS->isLiveOutOfMBB(LR, &MBB))
+ SGPRLiveRanges.push_back(std::make_pair(Def, &LR));
+ }
} else if (TRI->isSGPRClass(TRI->getPhysRegClass(Def))) {
SGPRLiveRanges.push_back(
std::make_pair(Def, &LIS->getRegUnit(Def)));
OpenPOWER on IntegriCloud