[llvm] eb23fdd - [SLP][NFC] Replace std::initializer_list SupportedOp with a C array

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 13 08:06:08 PDT 2026


Author: Alexey Bataev
Date: 2026-06-13T11:06:03-04:00
New Revision: eb23fddeb4e93b294f9c5db14dee577b14295c22

URL: https://github.com/llvm/llvm-project/commit/eb23fddeb4e93b294f9c5db14dee577b14295c22
DIFF: https://github.com/llvm/llvm-project/commit/eb23fddeb4e93b294f9c5db14dee577b14295c22.diff

LOG: [SLP][NFC] Replace std::initializer_list SupportedOp with a C array

Fixes a static_assert constant-expression build failure on older clang
(temporary initializer_list backing array).
Fixes #203184

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/203707

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Removed: 
    


################################################################################
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) &&


        


More information about the llvm-commits mailing list