blob: 5bfe453406b4bc24b262e0863c4fcb9ecf804362 [file] [log] [blame]
Krzysztof Parzyszek4094ab72018-03-20 19:35:09 +00001; RUN: llc -march=hexagon -enable-pipeliner -enable-bsb-sched=0 -join-liveintervals=false < %s | FileCheck %s
2
Jun Bum Lim2ecb7ba2018-03-22 20:06:47 +00003; XFAIL: *
4; This test is failing after post-ra machine sinking.
5
Krzysztof Parzyszek4094ab72018-03-20 19:35:09 +00006; Test that we generate the correct Phi values when there is a Phi that
7; references another Phi. We need to examine the other Phi to get the
8; correct value. We need to do this even if we haven't generated the
9; kernel code for the other Phi yet.
10
11; CHECK: [[REG0:(v[0-9]+)]] = [[REG1:(v[0-9]+)]]
12; CHECK: loop0
13; CHECK: [[REG0]] = [[REG1]]
14; CHECK: endloop0
15
16; Function Attrs: nounwind
17define void @f0() #0 {
18b0:
19 br i1 undef, label %b1, label %b2
20
21b1: ; preds = %b1, %b0
22 %v0 = phi i32 [ %v7, %b1 ], [ 0, %b0 ]
23 %v1 = phi <16 x i32> [ %v4, %b1 ], [ undef, %b0 ]
24 %v2 = phi <16 x i32> [ %v1, %b1 ], [ undef, %b0 ]
25 %v3 = tail call <16 x i32> @llvm.hexagon.V6.valignb(<16 x i32> %v1, <16 x i32> %v2, i32 62)
26 %v4 = tail call <16 x i32> @llvm.hexagon.V6.vaddh(<16 x i32> undef, <16 x i32> undef)
27 %v5 = tail call <16 x i32> @llvm.hexagon.V6.valignb(<16 x i32> %v4, <16 x i32> %v1, i32 2)
28 %v6 = tail call <16 x i32> @llvm.hexagon.V6.vabsdiffh(<16 x i32> %v3, <16 x i32> %v5)
29 store <16 x i32> %v6, <16 x i32>* null, align 64
30 %v7 = add nsw i32 %v0, 1
31 %v8 = icmp slt i32 %v7, undef
32 br i1 %v8, label %b1, label %b2
33
34b2: ; preds = %b1, %b0
35 ret void
36}
37
38; Function Attrs: nounwind readnone
39declare <16 x i32> @llvm.hexagon.V6.vaddh(<16 x i32>, <16 x i32>) #1
40
41; Function Attrs: nounwind readnone
42declare <16 x i32> @llvm.hexagon.V6.valignb(<16 x i32>, <16 x i32>, i32) #1
43
44; Function Attrs: nounwind readnone
45declare <16 x i32> @llvm.hexagon.V6.vabsdiffh(<16 x i32>, <16 x i32>) #1
46
47attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
48attributes #1 = { nounwind readnone }