Skip to content

Conversation

kazutakahirata
Copy link
Contributor

We can pass a range to llvm::is_contained.

We can pass a range to llvm::is_contained.
@llvmbot
Copy link
Member

llvmbot commented Aug 24, 2025

@llvm/pr-subscribers-backend-spir-v

Author: Kazu Hirata (kazutakahirata)

Changes

We can pass a range to llvm::is_contained.


Full diff: https://github.com/llvm/llvm-project/pull/155136.diff

1 Files Affected:

  • (modified) llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp (+1-1)
diff --git a/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp b/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
index 9f64eeb0088e2..e7da5504b2d58 100644
--- a/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp
@@ -228,7 +228,7 @@ SPIRVExtensionsParser::getValidExtensions(const Triple &TT) {
         SPIRV::OperandCategory::OperandCategory::ExtensionOperand,
         ExtensionEnum);
 
-    if (std::count(AllowedEnv.begin(), AllowedEnv.end(), CurrentEnvironment))
+    if (llvm::is_contained(AllowedEnv, CurrentEnvironment))
       R.insert(ExtensionEnum);
   }
 

@kazutakahirata kazutakahirata merged commit 8483bf4 into llvm:main Aug 24, 2025
11 of 12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250823_llvm_count_SPIRV branch August 24, 2025 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants