blob: e161f075530e0157834812cb7bf1293f624d774d [file] [log] [blame]
Krzysztof Parzyszek046090d2018-03-12 14:01:28 +00001; RUN: llc -march=hexagon < %s
2; REQUIRES: asserts
3
4; Splitting live ranges of vector predicate registers (in hexagon-peephole)
5; moved a PHI instruction into the middle of another basic block causing a
6; crash later on. Make sure this does not happen and that the testcase
7; compiles successfully.
8
9target triple = "hexagon"
10
11; Function Attrs: nounwind
12define void @f0() local_unnamed_addr #0 {
13b0:
14 %v0 = icmp eq i32 undef, 0
15 br i1 %v0, label %b1, label %b2
16
17b1: ; preds = %b0
18 %v1 = tail call <1024 x i1> @llvm.hexagon.V6.pred.not.128B(<1024 x i1> undef) #2
19 br label %b2
20
21b2: ; preds = %b1, %b0
22 %v2 = phi <1024 x i1> [ %v1, %b1 ], [ undef, %b0 ]
23 br label %b3
24
25b3: ; preds = %b3, %b2
26 %v3 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<1024 x i1> %v2, <32 x i32> undef, <32 x i32> undef) #2
27 %v4 = tail call <32 x i32> @llvm.hexagon.V6.vor.128B(<32 x i32> undef, <32 x i32> %v3) #2
28 %v5 = tail call <32 x i32> @llvm.hexagon.V6.vor.128B(<32 x i32> %v4, <32 x i32> undef) #2
29 %v6 = tail call <1024 x i1> @llvm.hexagon.V6.vgtub.128B(<32 x i32> %v5, <32 x i32> undef) #2
30 %v7 = tail call <1024 x i1> @llvm.hexagon.V6.pred.or.128B(<1024 x i1> %v6, <1024 x i1> undef) #2
31 %v8 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<1024 x i1> %v7, <32 x i32> undef, <32 x i32> undef) #2
32 tail call void asm sideeffect "if($0) vmem($1)=$2;", "q,r,v,~{memory}"(<32 x i32> undef, <32 x i32>* undef, <32 x i32> %v8) #2
33 br label %b3
34}
35
36; Function Attrs: nounwind readnone
37declare <32 x i32> @llvm.hexagon.V6.vmux.128B(<1024 x i1>, <32 x i32>, <32 x i32>) #1
38
39; Function Attrs: nounwind readnone
40declare <1024 x i1> @llvm.hexagon.V6.vgtub.128B(<32 x i32>, <32 x i32>) #1
41
42; Function Attrs: nounwind readnone
43declare <1024 x i1> @llvm.hexagon.V6.pred.or.128B(<1024 x i1>, <1024 x i1>) #1
44
45; Function Attrs: nounwind readnone
46declare <1024 x i1> @llvm.hexagon.V6.pred.not.128B(<1024 x i1>) #1
47
48; Function Attrs: nounwind readnone
49declare <32 x i32> @llvm.hexagon.V6.vor.128B(<32 x i32>, <32 x i32>) #1
50
51attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length128b" }
52attributes #1 = { nounwind readnone }
53attributes #2 = { nounwind }