[llvm] [VPlan] Remove loop region in optimizeForVFAndUF. (PR #108378)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 1 15:53:28 PST 2025


================
@@ -557,7 +556,7 @@ VPBasicBlock *VPBasicBlock::splitAt(iterator SplitAt) {
 template <typename T> static T *getEnclosingLoopRegionForRegion(T *P) {
   if (P && P->isReplicator()) {
     P = P->getParent();
-    assert(!cast<VPRegionBlock>(P)->isReplicator() &&
+    assert((!P || !cast<VPRegionBlock>(P)->isReplicator()) &&
----------------
ayalz wrote:

```suggestion
    assert(!getEnclosingLoopRegionForRegion(P) &&
```
?

Worth noting that a replicate region is allowed to be nested within a loop region, or not - if the latter is removed, but must not be nested within another replicate region.


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


More information about the llvm-commits mailing list