summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-15 00:12:30 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-08-15 00:12:30 +0000
commit4275c29a02f45cfc3b7b5f891c7b5f82c2dfc3e1 (patch)
treeee7e2e72c38c2e68f24a6b621050be87b14627ba /llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
parent650cc3dfd6525c8bf6390f80e825a82a1677ad79 (diff)
downloadbcm5719-llvm-4275c29a02f45cfc3b7b5f891c7b5f82c2dfc3e1.tar.gz
bcm5719-llvm-4275c29a02f45cfc3b7b5f891c7b5f82c2dfc3e1.zip
AMDGPU/SI: Make comments more precise.
True branch instructions do behave as expected with liveness. Avoid the phrasing "branch decision is based on a value in an SGPR" because this could be misleading. A VALU compare instruction's result is still based on an SGPR, even though that condition may be divergent. llvm-svn: 245131
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp b/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
index 7fed3afe843..a31a9d265cf 100644
--- a/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFixSGPRLiveRanges.cpp
@@ -7,9 +7,8 @@
//
//===----------------------------------------------------------------------===//
//
-/// \file
-/// SALU instructions ignore control flow, so we need to modify the live ranges
-/// of the registers they define in some cases.
+/// \file SALU instructions ignore the execution mask, so we need to modify the
+/// live ranges of the registers they define in some cases.
///
/// The main case we need to handle is when a def is used in one side of a
/// branch and not another. For example:
@@ -138,7 +137,8 @@ bool SIFixSGPRLiveRanges::runOnMachineFunction(MachineFunction &MF) {
if (MBB.succ_size() < 2)
continue;
- // We have structured control flow, so number of successors should be two.
+ // We have structured control flow, so the number of successors should be
+ // two.
assert(MBB.succ_size() == 2);
MachineBasicBlock *SuccA = *MBB.succ_begin();
MachineBasicBlock *SuccB = *(++MBB.succ_begin());
@@ -161,10 +161,10 @@ bool SIFixSGPRLiveRanges::runOnMachineFunction(MachineFunction &MF) {
unsigned Reg = RegLR.first;
LiveRange *LR = RegLR.second;
- // FIXME: We could be smarter here. If the register is Live-In to
- // one block, but the other doesn't have any SGPR defs, then there
- // won't be a conflict. Also, if the branch decision is based on
- // a value in an SGPR, then there will be no conflict.
+ // FIXME: We could be smarter here. If the register is Live-In to one
+ // block, but the other doesn't have any SGPR defs, then there won't be a
+ // conflict. Also, if the branch condition is uniform then there will be
+ // no conflict.
bool LiveInToA = LIS->isLiveInToMBB(*LR, SuccA);
bool LiveInToB = LIS->isLiveInToMBB(*LR, SuccB);
OpenPOWER on IntegriCloud