[llvm] 5ab9e00 - [AMDGPU] Fix -Wunused-variable in AMDGPUAtomicOptimizer.cpp (NFC)
Jie Fu via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 7 23:11:58 PDT 2024
Author: Jie Fu
Date: 2024-07-08T14:11:19+08:00
New Revision: 5ab9e003c8bd1e8b095869e472336447de1ed148
URL: https://github.com/llvm/llvm-project/commit/5ab9e003c8bd1e8b095869e472336447de1ed148
DIFF: https://github.com/llvm/llvm-project/commit/5ab9e003c8bd1e8b095869e472336447de1ed148.diff
LOG: [AMDGPU] Fix -Wunused-variable in AMDGPUAtomicOptimizer.cpp (NFC)
/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:688:18:
error: unused variable 'TyBitWidth' [-Werror,-Wunused-variable]
const unsigned TyBitWidth = DL->getTypeSizeInBits(Ty);
^
1 error generated.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
index 06e01a5ed3016..35d17bbe2bd9a 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
@@ -685,7 +685,7 @@ void AMDGPUAtomicOptimizerImpl::optimizeAtomic(Instruction &I,
Type *const Ty = I.getType();
Type *Int32Ty = B.getInt32Ty();
bool isAtomicFloatingPointTy = Ty->isFloatingPointTy();
- const unsigned TyBitWidth = DL->getTypeSizeInBits(Ty);
+ [[maybe_unused]] const unsigned TyBitWidth = DL->getTypeSizeInBits(Ty);
// This is the value in the atomic operation we need to combine in order to
// reduce the number of atomic operations.
More information about the llvm-commits
mailing list