[PATCH] D139522: [AMDGPU] Small cleanup in insertWaitcntInBlock()
Stephen Thomas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 03:59:23 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGab2e27faa4cb: [AMDGPU] Small cleanup in insertWaitcntInBlock() (authored by stepthomas).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139522/new/
https://reviews.llvm.org/D139522
Files:
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
Index: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1528,6 +1528,13 @@
return StrictDom;
}
+static bool isWaitInstr(MachineInstr &Inst) {
+ return Inst.getOpcode() == AMDGPU::S_WAITCNT ||
+ (Inst.getOpcode() == AMDGPU::S_WAITCNT_VSCNT &&
+ Inst.getOperand(0).isReg() &&
+ Inst.getOperand(0).getReg() == AMDGPU::SGPR_NULL);
+}
+
// Generate s_waitcnt instructions where needed.
bool SIInsertWaitcnts::insertWaitcntInBlock(MachineFunction &MF,
MachineBasicBlock &Block,
@@ -1563,10 +1570,7 @@
// Track pre-existing waitcnts that were added in earlier iterations or by
// the memory legalizer.
- if (Inst.getOpcode() == AMDGPU::S_WAITCNT ||
- (Inst.getOpcode() == AMDGPU::S_WAITCNT_VSCNT &&
- Inst.getOperand(0).isReg() &&
- Inst.getOperand(0).getReg() == AMDGPU::SGPR_NULL)) {
+ if (isWaitInstr(Inst)) {
if (!OldWaitcntInstr)
OldWaitcntInstr = &Inst;
++Iter;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139522.480846.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/3f851315/attachment.bin>
More information about the llvm-commits
mailing list