[llvm] LoopVectorize ptr init (PR #139807)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed May 14 05:38:45 PDT 2025
================
@@ -603,13 +603,13 @@ class InnerLoopVectorizer {
// --- Vectorization state ---
/// The vector-loop preheader.
- BasicBlock *LoopVectorPreHeader;
+ BasicBlock *LoopVectorPreHeader = nullptr;
/// The scalar-loop preheader.
- BasicBlock *LoopScalarPreHeader;
+ BasicBlock *LoopScalarPreHeader = nullptr;
/// Middle Block between the vector and the scalar.
- BasicBlock *LoopMiddleBlock;
+ BasicBlock *LoopMiddleBlock = nullptr;
----------------
david-arm wrote:
This looks like a nice fix! An alternative might be to disable the default constructor by adding
```
InnerLoopVectorizer() = delete;
```
and then forcing the existing InnerLoopVectorizer constructor to explicitly set `LoopVectorPreHeader`, etc. to nullptr, as well as others such as `AddedSafetyChecks`? That way all the sensible defaults are being set in the same place. Any thoughts @fhahn?
https://github.com/llvm/llvm-project/pull/139807
More information about the llvm-commits
mailing list