summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-08-01 01:25:27 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-08-01 01:25:27 +0000
commitd48324ff6fe77e0ef26060294905e1bc64b8535d (patch)
tree9b4fc5511c46f993ceb5aa6b23b7212a4836e348 /llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
parent79c27c9464f1605a56d31d2c49d143117ad434a2 (diff)
downloadbcm5719-llvm-d48324ff6fe77e0ef26060294905e1bc64b8535d.tar.gz
bcm5719-llvm-d48324ff6fe77e0ef26060294905e1bc64b8535d.zip
Reapply "AMDGPU: Split block for si_end_cf"
This reverts commit r359363, reapplying r357634 llvm-svn: 367500
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp b/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
index 7e10316eab9..4b17cf4e632 100644
--- a/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
+++ b/llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
@@ -82,14 +82,14 @@ FunctionPass *llvm::createSIOptimizeExecMaskingPreRAPass() {
return new SIOptimizeExecMaskingPreRA();
}
-static bool isEndCF(const MachineInstr &MI, const SIRegisterInfo *TRI,
- const GCNSubtarget &ST) {
+static bool isEndCF(const MachineInstr &MI, const GCNSubtarget &ST,
+ const SIRegisterInfo *TRI) {
if (ST.isWave32()) {
- return MI.getOpcode() == AMDGPU::S_OR_B32 &&
+ return MI.getOpcode() == AMDGPU::S_OR_B32_term &&
MI.modifiesRegister(AMDGPU::EXEC_LO, TRI);
}
- return MI.getOpcode() == AMDGPU::S_OR_B64 &&
+ return MI.getOpcode() == AMDGPU::S_OR_B64_term &&
MI.modifiesRegister(AMDGPU::EXEC, TRI);
}
@@ -380,13 +380,13 @@ bool SIOptimizeExecMaskingPreRA::runOnMachineFunction(MachineFunction &MF) {
// Try to collapse adjacent endifs.
auto E = MBB.end();
- auto Lead = skipDebugInstructionsForward(MBB.begin(), E);
- if (MBB.succ_size() != 1 || Lead == E || !isEndCF(*Lead, TRI, ST))
+ auto Lead = MBB.getFirstTerminator();
+ if (MBB.succ_size() != 1 || Lead == E || !isEndCF(*Lead, ST, TRI))
continue;
MachineBasicBlock *TmpMBB = &MBB;
auto NextLead = skipIgnoreExecInstsTrivialSucc(TmpMBB, std::next(Lead));
- if (NextLead == TmpMBB->end() || !isEndCF(*NextLead, TRI, ST) ||
+ if (NextLead == TmpMBB->end() || !isEndCF(*NextLead, ST, TRI) ||
!getOrExecSource(*NextLead, *TII, MRI, ST))
continue;
OpenPOWER on IntegriCloud