[llvm] [LV] Initialize IR block pointers in ILV. (NFC) (PR #139807)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 01:14:17 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:

Yeah, I was just wondering if it was worth enforcing this by explicitly removing the default constructor. At the moment it feels more like an unwritten rule, although in practice it's probably not the sort of class that's going to be used frequently elsewhere.

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


More information about the llvm-commits mailing list