[llvm] [AArch64] Don't run loop-idiom-vectorize pass in the O0 pipeline (PR #156802)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 22:24:36 PDT 2025


================
@@ -107,6 +107,7 @@ add_llvm_target(AArch64CodeGen
   Core
   GlobalISel
   MC
+  Passes
----------------
MaskRay wrote:

`OptimizationLevel::O0` is a variable defined by Passes .cpp file. This is needed to avoid an undefined symbol linker error. I don't find a way to define a `static constexpr variable ` of type OptimizationLevel within OptimizationLevel. Before `}`, the class `OptimizationLevel` is not considered a literal class.

```
struct A {
    int a, b;
    constexpr A(int a, int b) : a(a), b(b) {}
    
    static constexpr A default_value{0, 0};
};

// would cause
error: constexpr variable cannot have non-literal type 'const A'
    6 |   static constexpr inline A default_value{0, 0};
```

https://github.com/llvm/llvm-project/pull/156802


More information about the llvm-commits mailing list