[llvm] [VPlan] Remove CanonicalIV when dissolving loop regions (NFC). (PR #142372)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 01:54:54 PDT 2025


================
@@ -883,6 +883,16 @@ void VPRegionBlock::print(raw_ostream &O, const Twine &Indent,
 
 void VPRegionBlock::dissolveToCFGLoop() {
   auto *Header = cast<VPBasicBlock>(getEntry());
+  if (auto *CanIV = dyn_cast<VPCanonicalIVPHIRecipe>(&Header->front())) {
+    assert(this == getPlan()->getVectorLoopRegion() &&
----------------
fhahn wrote:

Yep that would also do the trick, but doing it here has the advantage it cannot be missed by potential other users 

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


More information about the llvm-commits mailing list