[llvm] 817c831 - [AMDGPU] Switch to named simm16 in vscnt insertion
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 25 13:05:38 PDT 2020
Author: Stanislav Mekhanoshin
Date: 2020-08-25T13:05:27-07:00
New Revision: 817c831f023af3a5a08e72f7454c4fbb771edc1c
URL: https://github.com/llvm/llvm-project/commit/817c831f023af3a5a08e72f7454c4fbb771edc1c
DIFF: https://github.com/llvm/llvm-project/commit/817c831f023af3a5a08e72f7454c4fbb771edc1c.diff
LOG: [AMDGPU] Switch to named simm16 in vscnt insertion
Differential Revision: https://reviews.llvm.org/D86568
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index 5ab6edf3f606..e4d341c6382b 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1090,8 +1090,8 @@ bool SIInsertWaitcnts::generateWaitcntInstBefore(
} else {
assert(II->getOpcode() == AMDGPU::S_WAITCNT_VSCNT);
assert(II->getOperand(0).getReg() == AMDGPU::SGPR_NULL);
- ScoreBrackets.applyWaitcnt(
- AMDGPU::Waitcnt(~0u, ~0u, ~0u, II->getOperand(1).getImm()));
+ auto W = TII->getNamedOperand(*II, AMDGPU::OpName::simm16)->getImm();
+ ScoreBrackets.applyWaitcnt(AMDGPU::Waitcnt(~0u, ~0u, ~0u, W));
}
}
}
@@ -1139,12 +1139,13 @@ bool SIInsertWaitcnts::generateWaitcntInstBefore(
assert(II->getOpcode() == AMDGPU::S_WAITCNT_VSCNT);
assert(II->getOperand(0).getReg() == AMDGPU::SGPR_NULL);
- unsigned ICnt = II->getOperand(1).getImm();
+ unsigned ICnt = TII->getNamedOperand(*II, AMDGPU::OpName::simm16)
+ ->getImm();
OldWait.VsCnt = std::min(OldWait.VsCnt, ICnt);
if (!TrackedWaitcntSet.count(&*II))
Wait.VsCnt = std::min(Wait.VsCnt, ICnt);
if (Wait.VsCnt != ICnt) {
- II->getOperand(1).setImm(Wait.VsCnt);
+ TII->getNamedOperand(*II, AMDGPU::OpName::simm16)->setImm(Wait.VsCnt);
Modified = true;
}
Wait.VsCnt = ~0u;
More information about the llvm-commits
mailing list