[llvm] [SPIRV] Silence unused variable warnings (PR #95492)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 18:09:49 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-spir-v
Author: Chris B (llvm-beanz)
<details>
<summary>Changes</summary>
This change marks a few variable declarations as [[maybe_unused]] to silence unused variable warnings.
---
Full diff: https://github.com/llvm/llvm-project/pull/95492.diff
2 Files Affected:
- (modified) llvm/lib/Target/SPIRV/Analysis/SPIRVConvergenceRegionAnalysis.cpp (+1-1)
- (modified) llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Target/SPIRV/Analysis/SPIRVConvergenceRegionAnalysis.cpp b/llvm/lib/Target/SPIRV/Analysis/SPIRVConvergenceRegionAnalysis.cpp
index 7f5f7d0b1e4dc..25e285e35f933 100644
--- a/llvm/lib/Target/SPIRV/Analysis/SPIRVConvergenceRegionAnalysis.cpp
+++ b/llvm/lib/Target/SPIRV/Analysis/SPIRVConvergenceRegionAnalysis.cpp
@@ -138,7 +138,7 @@ ConvergenceRegion::ConvergenceRegion(
SmallPtrSet<BasicBlock *, 8> &&Blocks, SmallPtrSet<BasicBlock *, 2> &&Exits)
: DT(DT), LI(LI), ConvergenceToken(ConvergenceToken), Entry(Entry),
Exits(std::move(Exits)), Blocks(std::move(Blocks)) {
- for (auto *BB : this->Exits)
+ for ([[maybe_unused]] auto *BB : this->Exits)
assert(this->Blocks.count(BB) != 0);
assert(this->Blocks.count(this->Entry) != 0);
}
diff --git a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
index 2a515359bdd4f..c14e5098be711 100644
--- a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
@@ -2418,7 +2418,7 @@ Type *parseBuiltinCallArgumentBaseType(const StringRef DemangledCall,
if (hasBuiltinTypePrefix(TypeStr)) {
// OpenCL builtin types in demangled call strings have the following format:
// e.g. ocl_image2d_ro
- bool IsOCLBuiltinType = TypeStr.consume_front("ocl_");
+ [[maybe_unused]] bool IsOCLBuiltinType = TypeStr.consume_front("ocl_");
assert(IsOCLBuiltinType && "Invalid OpenCL builtin prefix");
// Check if this is pointer to a builtin type and not just pointer
``````````
</details>
https://github.com/llvm/llvm-project/pull/95492
More information about the llvm-commits
mailing list