31 lines · plain
1; RUN: opt < %s -passes=loop-vectorize -force-vector-width=4 -S | FileCheck %s2 3; Out of the LCSSA form we could have 'phi i32 [ loop-invariant, %for.inc.2.i ]'4; but the IR Verifier requires for PHI one entry for each predecessor of5; it's parent basic block. The original PR14725 solution for the issue just6; added 'undef' for an predecessor BB and which is not correct. We copy the real7; value for another predecessor instead of bringing 'undef'.8 9; CHECK-LABEL: for.cond.preheader:10; CHECK: %e.0.ph = phi i32 [ 0, %if.end.2.i ], [ 0, %middle.block ]11 12; Function Attrs: nounwind uwtable13define void @main(i32 %n, i32 %v) #0 {14entry:15 br label %for.cond1.preheader.i16 17for.cond1.preheader.i: ; preds = %if.end.2.i, %entry18 %c.06.i = phi i32 [ 0, %entry ], [ %inc5.i, %if.end.2.i ]19 %tobool.i = icmp ne i32 %v, 020 br label %if.end.2.i21 22if.end.2.i: ; preds = %for.cond1.preheader.i23 %inc5.i = add nsw i32 %c.06.i, 124 %cmp.i = icmp slt i32 %inc5.i, %n25 br i1 %cmp.i, label %for.cond1.preheader.i, label %for.cond.preheader26 27for.cond.preheader: ; preds = %if.end.2.i28 %e.0.ph = phi i32 [ 0, %if.end.2.i ]29 unreachable30}31