Skip to content

LoopVectorize ptr init #139807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gchaltas
Copy link
Contributor

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.

Setting unitialized pointers to nullptr in InnerLoopVectorizer() constructor
@llvmbot
Copy link
Member

llvmbot commented May 13, 2025

@llvm/pr-subscribers-llvm-transforms

Author: George Chaltas (gchaltas)

Changes

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 --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;

@llvmbot
Copy link
Member

llvmbot commented May 13, 2025

@llvm/pr-subscribers-vectorizers

Author: George Chaltas (gchaltas)

Changes

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 --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;

@gchaltas
Copy link
Contributor Author

gchaltas commented May 13, 2025

@fhahn would you please review this and merge if you find it appropriate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants