• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -newgvn %s -S -o - | FileCheck %s
3define hidden void @foo() {
4; CHECK-LABEL: @foo(
5; CHECK-NEXT:  top:
6; CHECK-NEXT:    br label [[IF:%.*]]
7; CHECK:       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]]
11; CHECK:       L50:
12; CHECK-NEXT:    store i8 undef, i8* null
13; CHECK-NEXT:    ret void
14;
15top:
16  %.promoted = load double, double* undef, align 8
17  br label %if
18
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.
22
23if:                                               ; 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
27
28L50:                                              ; preds = %if
29  %.lcssa = phi double [ %1, %if ]
30  store double %.lcssa, double* undef, align 8
31  ret void
32}
33
34