[llvm] [VPlan] Handle regions with live-outs and scalar VF when replicating. (PR #186252)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 29 05:15:32 PDT 2026


================
@@ -1637,7 +1637,11 @@ void VPPhi::execute(VPTransformState &State) {
   PHINode *NewPhi = State.Builder.CreatePHI(
       State.TypeAnalysis.inferScalarType(this), 2, getName());
   unsigned NumIncoming = getNumIncoming();
-  if (getParent() != getParent()->getPlan()->getScalarPreheader()) {
+  // Detect header phis: the parent block dominates its second incoming block
+  // (the latch). Non-header phis, e.g. from dissolved replicate regions, don't
+  // have this property.
----------------
fhahn wrote:

I think we can remove it, alternative would be to have a general pass after executing to add all incoming values for all phis

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


More information about the llvm-commits mailing list