[llvm] [LV] Fix unsafe canVectorizeWithIfConvert() checks (PR #203273)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 07:49:37 PDT 2026


================
@@ -2962,7 +2962,10 @@ bool LoopAccessInfo::blockNeedsPredication(const BasicBlock *BB,
   assert(TheLoop->contains(BB) && "Unknown block used");
 
   // Blocks that do not dominate the latch need predication.
+  // Treat blocks in loops with no unique latch as always needing predication.
   const BasicBlock *Latch = TheLoop->getLoopLatch();
+  if (!Latch)
----------------
huntergr-arm wrote:

Another would be to return an optional or Expected wrapper, and let the caller decide whether to ignore it or assert.

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


More information about the llvm-commits mailing list