[PATCH] D132292: [NFC][AMDGPU] Some cleanups in the SIOptimizeExecMasking pass.
Thomas Symalla via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 20 06:14:04 PDT 2022
tsymalla created this revision.
tsymalla added a reviewer: foad.
Herald added subscribers: kosarev, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: All.
tsymalla requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Fix typos and remove an unused argument.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D132292
Files:
llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
Index: llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
+++ llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
@@ -39,8 +39,8 @@
MachineBasicBlock::reverse_iterator
fixTerminators(MachineBasicBlock &MBB) const;
MachineBasicBlock::reverse_iterator
- findExecCopy(MachineBasicBlock &MBB, MachineBasicBlock::reverse_iterator I,
- unsigned CopyToExec) const;
+ findExecCopy(MachineBasicBlock &MBB,
+ MachineBasicBlock::reverse_iterator I) const;
bool isRegisterInUseBetween(MachineInstr &Stop, MachineInstr &Start,
MCRegister Reg, bool UseLiveOuts = false,
@@ -296,10 +296,8 @@
return FirstNonTerm;
}
-MachineBasicBlock::reverse_iterator
-SIOptimizeExecMasking::findExecCopy(MachineBasicBlock &MBB,
- MachineBasicBlock::reverse_iterator I,
- unsigned CopyToExec) const {
+MachineBasicBlock::reverse_iterator SIOptimizeExecMasking::findExecCopy(
+ MachineBasicBlock &MBB, MachineBasicBlock::reverse_iterator I) const {
const unsigned InstLimit = 25;
auto E = MBB.rend();
@@ -370,7 +368,6 @@
LR.addLiveOuts(*Stop.getParent());
MachineBasicBlock::reverse_iterator A(Start);
- MachineBasicBlock::reverse_iterator E(Stop);
if (IgnoreStart)
++A;
@@ -425,7 +422,7 @@
// Scan backwards to find the def.
auto *CopyToExecInst = &*I;
- auto CopyFromExecInst = findExecCopy(MBB, I, CopyToExec);
+ auto CopyFromExecInst = findExecCopy(MBB, I);
if (CopyFromExecInst == E) {
auto PrepareExecInst = std::next(I);
if (PrepareExecInst == E)
@@ -635,7 +632,7 @@
return;
// Tries to find a possibility to optimize a v_cmp ..., s_and_saveexec
- // sequence by looking at an instance of a s_and_saveexec instruction. Returns
+ // sequence by looking at an instance of an s_and_saveexec instruction. Returns
// a pointer to the v_cmp instruction if it is safe to replace the sequence
// (see the conditions in the function body). This is after register
// allocation, so some checks on operand dependencies need to be considered.
@@ -669,7 +666,7 @@
return;
// Don't do the transformation if the destination operand is included in
- // it's MBB Live-outs, meaning it's used in any of it's successors, leading
+ // it's MBB Live-outs, meaning it's used in any of its successors, leading
// to incorrect code if the v_cmp and therefore the def of
// the dest operand is removed.
if (isLiveOut(*VCmp->getParent(), VCmpDest->getReg()))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132292.454203.patch
Type: text/x-patch
Size: 2686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220820/8c5cc88c/attachment.bin>
More information about the llvm-commits
mailing list