[llvm] [SLP][NFC] Replace std::initializer_list SupportedOp with a C array (PR #203707)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 13 08:06:32 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Alexey Bataev (alexey-bataev)
<details>
<summary>Changes</summary>
Fixes a static_assert constant-expression build failure on older clang
(temporary initializer_list backing array).
Fixes #<!-- -->203184
---
Full diff: https://github.com/llvm/llvm-project/pull/203707.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 3d5b0ebb99f4a..5e58d0eb0fa26 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -1031,7 +1031,7 @@ namespace {
class BinOpSameOpcodeHelper {
using MaskType = std::uint_fast32_t;
/// Sort SupportedOp because it is used by binary_search.
- constexpr static std::initializer_list<unsigned> SupportedOp = {
+ constexpr static unsigned SupportedOp[] = {
Instruction::Add, Instruction::Sub, Instruction::Mul, Instruction::Shl,
Instruction::AShr, Instruction::And, Instruction::Or, Instruction::Xor};
static_assert(llvm::is_sorted_constexpr(SupportedOp) &&
``````````
</details>
https://github.com/llvm/llvm-project/pull/203707
More information about the llvm-commits
mailing list