xref: /llvm-project/llvm/test/Transforms/SLPVectorizer/X86/phi-removed-on-operand-vectorization.ll (revision af21bc19172410f29606cac82a96c33d6710fe38)
1*af21bc19SAlexey Bataev; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2*af21bc19SAlexey Bataev; RUN: opt -S --passes=slp-vectorizer -mtriple=i386-pc-windows-msvc19.34.0 -mcpu=pentium4 < %s | FileCheck %s
3*af21bc19SAlexey Bataev
4*af21bc19SAlexey Bataevdefine i32 @test(double %mul321.i) {
5*af21bc19SAlexey Bataev; CHECK-LABEL: define i32 @test(
6*af21bc19SAlexey Bataev; CHECK-SAME: double [[MUL321_I:%.*]]) #[[ATTR0:[0-9]+]] {
7*af21bc19SAlexey Bataev; CHECK-NEXT:  [[ENTRY:.*]]:
8*af21bc19SAlexey Bataev; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <2 x double> poison, double [[MUL321_I]], i32 0
9*af21bc19SAlexey Bataev; CHECK-NEXT:    br label %[[DO_BODY220_I:.*]]
10*af21bc19SAlexey Bataev; CHECK:       [[DO_BODY220_I]]:
11*af21bc19SAlexey Bataev; CHECK-NEXT:    [[TMP1:%.*]] = phi <2 x double> [ [[TMP6:%.*]], %[[DO_BODY221_I:.*]] ], [ zeroinitializer, %[[ENTRY]] ]
12*af21bc19SAlexey Bataev; CHECK-NEXT:    br label %[[DO_BODY221_I]]
13*af21bc19SAlexey Bataev; CHECK:       [[DO_BODY221_I]]:
14*af21bc19SAlexey Bataev; CHECK-NEXT:    [[TMP2:%.*]] = fadd <2 x double> [[TMP1]], zeroinitializer
15*af21bc19SAlexey Bataev; CHECK-NEXT:    [[TMP3:%.*]] = fmul <2 x double> [[TMP2]], zeroinitializer
16*af21bc19SAlexey Bataev; CHECK-NEXT:    [[TMP4:%.*]] = extractelement <2 x double> [[TMP3]], i32 0
17*af21bc19SAlexey Bataev; CHECK-NEXT:    [[TMP5:%.*]] = extractelement <2 x double> [[TMP3]], i32 1
18*af21bc19SAlexey Bataev; CHECK-NEXT:    [[ADD318_I:%.*]] = fadd double [[TMP4]], [[TMP5]]
19*af21bc19SAlexey Bataev; CHECK-NEXT:    [[TMP6]] = insertelement <2 x double> [[TMP0]], double [[ADD318_I]], i32 1
20*af21bc19SAlexey Bataev; CHECK-NEXT:    br label %[[DO_BODY220_I]]
21*af21bc19SAlexey Bataev;
22*af21bc19SAlexey Bataeventry:
23*af21bc19SAlexey Bataev  br label %do.body220.i
24*af21bc19SAlexey Bataev
25*af21bc19SAlexey Bataevdo.body220.i:
26*af21bc19SAlexey Bataev  %c1.2.i = phi double [ %mul321.i, %do.body221.i ], [ 0.000000e+00, %entry ]
27*af21bc19SAlexey Bataev  %s1.1.i = phi double [ %add318.i, %do.body221.i ], [ 0.000000e+00, %entry ]
28*af21bc19SAlexey Bataev  br label %do.body221.i
29*af21bc19SAlexey Bataev
30*af21bc19SAlexey Bataevdo.body221.i:                                     ; preds = %do.body220.i
31*af21bc19SAlexey Bataev  %sub311.i1 = fadd double %c1.2.i, 0.000000e+00
32*af21bc19SAlexey Bataev  %add315.i = fadd double %s1.1.i, 0.000000e+00
33*af21bc19SAlexey Bataev  %mul316.i = fmul double %sub311.i1, 0.000000e+00
34*af21bc19SAlexey Bataev  %mul317.i = fmul double %add315.i, 0.000000e+00
35*af21bc19SAlexey Bataev  %add318.i = fadd double %mul316.i, %mul317.i
36*af21bc19SAlexey Bataev  br label %do.body220.i
37*af21bc19SAlexey Bataev}
38