[llvm] f0b44ce - [AMDGPU] Fix -Wunused-variable in SIInsertWaitcnts.cpp (NFC)
Jie Fu via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 15 04:04:25 PST 2023
Author: Jie Fu
Date: 2023-12-15T20:00:18+08:00
New Revision: f0b44ce28eaf3dbea557f36b6bd1d9fcd7c084b8
URL: https://github.com/llvm/llvm-project/commit/f0b44ce28eaf3dbea557f36b6bd1d9fcd7c084b8
DIFF: https://github.com/llvm/llvm-project/commit/f0b44ce28eaf3dbea557f36b6bd1d9fcd7c084b8.diff
LOG: [AMDGPU] Fix -Wunused-variable in SIInsertWaitcnts.cpp (NFC)
llvm-project/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1322:10:
error: unused variable 'SWaitInst' [-Werror,-Wunused-variable]
auto SWaitInst =
^
llvm-project/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1334:10:
error: unused variable 'SWaitInst' [-Werror,-Wunused-variable]
auto SWaitInst = BuildMI(Block, It, DL, TII->get(AMDGPU::S_WAITCNT_VSCNT))
^
2 errors generated.
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 d7271f4ad48dbc..8415a3d77d3bcd 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1319,7 +1319,7 @@ bool SIInsertWaitcnts::generateWaitcnt(AMDGPU::Waitcnt Wait,
// instruction was modified to handle the required wait.
if (Wait.hasWaitExceptVsCnt()) {
unsigned Enc = AMDGPU::encodeWaitcnt(IV, Wait);
- auto SWaitInst =
+ [[maybe_unused]] auto SWaitInst =
BuildMI(Block, It, DL, TII->get(AMDGPU::S_WAITCNT)).addImm(Enc);
Modified = true;
@@ -1331,7 +1331,7 @@ bool SIInsertWaitcnts::generateWaitcnt(AMDGPU::Waitcnt Wait,
if (Wait.hasWaitVsCnt()) {
assert(ST->hasVscnt());
- auto SWaitInst = BuildMI(Block, It, DL, TII->get(AMDGPU::S_WAITCNT_VSCNT))
+ [[maybe_unused]] auto SWaitInst = BuildMI(Block, It, DL, TII->get(AMDGPU::S_WAITCNT_VSCNT))
.addReg(AMDGPU::SGPR_NULL, RegState::Undef)
.addImm(Wait.VsCnt);
Modified = true;
More information about the llvm-commits
mailing list