1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -newgvn %s -S -o - | FileCheck %s
3 define hidden void @foo() {
6 ; CHECK-NEXT: br label [[IF:%.*]]
8 ; CHECK-NEXT: [[TMP0:%.*]] = phi double [ [[TMP1:%.*]], [[IF]] ], [ undef, [[TOP:%.*]] ]
9 ; CHECK-NEXT: [[TMP1]] = fadd double [[TMP0]], 1.000000e+00
10 ; CHECK-NEXT: br i1 false, label [[L50:%.*]], label [[IF]]
12 ; CHECK-NEXT: store i8 undef, i8* null
13 ; CHECK-NEXT: ret void
16 %.promoted = load double, double* undef, align 8
19 ;; This is really a multi-valued phi, because the phi is defined by an expression of the phi.
20 ;; This means that we can't propagate the value over the backedge, because we'll just cycle
21 ;; through every value.
23 if: ; preds = %if, %top
24 %0 = phi double [ %1, %if ], [ %.promoted, %top ]
25 %1 = fadd double %0, 1.0
26 br i1 false, label %L50, label %if
29 %.lcssa = phi double [ %1, %if ]
30 store double %.lcssa, double* undef, align 8