[llvm] LoopVectorize ptr init (PR #139807)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 13 16:05:39 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: George Chaltas (gchaltas)

<details>
<summary>Changes</summary>

Setting unitialized pointers to nullptr in InnerLoopVectorizer() constructor.   These were noticed during a review of the code.  Seems like a good idea to clean them up.

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


1 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+3-3) 


``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index d04fea5d9b0ac..742ef585cb1f7 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -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;
 
   /// A list of all bypass blocks. The first block is the entry of the loop.
   SmallVector<BasicBlock *, 4> LoopBypassBlocks;

``````````

</details>


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


More information about the llvm-commits mailing list