1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt %s -passes='function(scalarizer)' -S -o - | FileCheck %s
4 ; This input caused the scalarizer to insert non-PHI nodes
5 ; in between PHI nodes (%1 and %2).
7 define <3 x float> @func(i32 %inval) {
10 ; CHECK-NEXT: br label [[TMP0:%.*]]
12 ; CHECK-NEXT: [[DOTI01:%.*]] = phi float [ 0.000000e+00, [[DOTENTRY:%.*]] ], [ [[DOTI01]], [[TMP3:%.*]] ]
13 ; CHECK-NEXT: [[DOTI12:%.*]] = phi float [ 0.000000e+00, [[DOTENTRY]] ], [ [[DOTI12]], [[TMP3]] ]
14 ; CHECK-NEXT: [[DOTI23:%.*]] = phi float [ 0.000000e+00, [[DOTENTRY]] ], [ [[DOTI23]], [[TMP3]] ]
15 ; CHECK-NEXT: [[TMP1:%.*]] = phi float [ 1.000000e+00, [[DOTENTRY]] ], [ 2.000000e+00, [[TMP3]] ]
16 ; CHECK-NEXT: [[DOTUPTO0:%.*]] = insertelement <3 x float> poison, float [[DOTI01]], i64 0
17 ; CHECK-NEXT: [[DOTUPTO1:%.*]] = insertelement <3 x float> [[DOTUPTO0]], float [[DOTI12]], i64 1
18 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <3 x float> [[DOTUPTO1]], float [[DOTI23]], i64 2
19 ; CHECK-NEXT: br label [[TMP3]]
21 ; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 [[INVAL:%.*]], 0
22 ; CHECK-NEXT: br i1 [[COND]], label [[TMP0]], label [[EXIT:%.*]]
24 ; CHECK-NEXT: ret <3 x float> [[TMP2]]
29 0: ; preds = %3, %.entry
30 %1 = phi <3 x float> [ <float 0.0, float 0.0, float 0.0>, %.entry], [ %1, %3 ]
31 %2 = phi float [ 1.0, %.entry], [ 2.0, %3 ]
35 %cond = icmp eq i32 %inval, 0
36 br i1 %cond, label %0, label %exit