• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -fp-contract=fast -O3 -march=hexagon -mcpu=hexagonv5 < %s
2; REQUIRES: asserts
3
4; Test that the pipeliner doesn't ICE due because the PHI generation
5; code in the epilog does not attempt to reuse an existing PHI.
6
7define void @test(float* noalias %srcImg, i32 %width, float* noalias %dstImg) {
8entry.split:
9  %shr = lshr i32 %width, 1
10  %incdec.ptr253 = getelementptr inbounds float, float* %dstImg, i32 2
11  br i1 undef, label %for.body, label %for.end
12
13for.body:
14  %dst.21518.reg2mem.0 = phi float* [ null, %while.end712 ], [ %incdec.ptr253, %entry.split ]
15  %dstEnd.01519 = phi float* [ %add.ptr725, %while.end712 ], [ undef, %entry.split ]
16  %add.ptr367 = getelementptr inbounds float, float* %srcImg, i32 undef
17  %dst.31487 = getelementptr inbounds float, float* %dst.21518.reg2mem.0, i32 1
18  br i1 undef, label %while.body661.preheader, label %while.end712
19
20while.body661.preheader:
21  %scevgep1941 = getelementptr float, float* %add.ptr367, i32 1
22  br label %while.body661.ur
23
24while.body661.ur:
25  %lsr.iv1942 = phi float* [ %scevgep1941, %while.body661.preheader ], [ undef, %while.body661.ur ]
26  %col1.31508.reg2mem.0.ur = phi float [ %col3.31506.reg2mem.0.ur, %while.body661.ur ], [ undef, %while.body661.preheader ]
27  %col4.31507.reg2mem.0.ur = phi float [ %add710.ur, %while.body661.ur ], [ 0.000000e+00, %while.body661.preheader ]
28  %col3.31506.reg2mem.0.ur = phi float [ %add689.ur, %while.body661.ur ], [ undef, %while.body661.preheader ]
29  %dst.41511.ur = phi float* [ %incdec.ptr674.ur, %while.body661.ur ], [ %dst.31487, %while.body661.preheader ]
30  %mul662.ur = fmul float %col1.31508.reg2mem.0.ur, 4.000000e+00
31  %add663.ur = fadd float undef, %mul662.ur
32  %add665.ur = fadd float %add663.ur, undef
33  %add667.ur = fadd float undef, %add665.ur
34  %add669.ur = fadd float undef, %add667.ur
35  %add670.ur = fadd float %col4.31507.reg2mem.0.ur, %add669.ur
36  %conv673.ur = fmul float %add670.ur, 3.906250e-03
37  %incdec.ptr674.ur = getelementptr inbounds float, float* %dst.41511.ur, i32 1
38  store float %conv673.ur, float* %dst.41511.ur, align 4
39  %scevgep1959 = getelementptr float, float* %lsr.iv1942, i32 -1
40  %0 = load float, float* %scevgep1959, align 4
41  %mul680.ur = fmul float %0, 4.000000e+00
42  %add681.ur = fadd float undef, %mul680.ur
43  %add684.ur = fadd float undef, %add681.ur
44  %add687.ur = fadd float undef, %add684.ur
45  %add689.ur = fadd float undef, %add687.ur
46  %add699.ur = fadd float undef, undef
47  %add703.ur = fadd float undef, %add699.ur
48  %add707.ur = fadd float undef, %add703.ur
49  %add710.ur = fadd float undef, %add707.ur
50  %cmp660.ur = icmp ult float* %incdec.ptr674.ur, %dstEnd.01519
51  br i1 %cmp660.ur, label %while.body661.ur, label %while.end712
52
53while.end712:
54  %dst.4.lcssa.reg2mem.0 = phi float* [ %dst.31487, %for.body ], [ undef, %while.body661.ur ]
55  %conv721 = fpext float undef to double
56  %mul722 = fmul double %conv721, 0x3F7111112119E8FB
57  %conv723 = fptrunc double %mul722 to float
58  store float %conv723, float* %dst.4.lcssa.reg2mem.0, align 4
59  %add.ptr725 = getelementptr inbounds float, float* %dstEnd.01519, i32 %shr
60  %cmp259 = icmp ult i32 undef, undef
61  br i1 %cmp259, label %for.body, label %for.end
62
63for.end:
64  ret void
65}
66