1 ; RUN: llc -march=hexagon < %s
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.
9 target triple = "hexagon"
11 ; Function Attrs: nounwind
12 define void @f0() local_unnamed_addr #0 {
14 %v0 = icmp eq i32 undef, 0
15 br i1 %v0, label %b1, label %b2
18 %v1 = tail call <128 x i1> @llvm.hexagon.V6.pred.not.128B(<128 x i1> undef) #2
21 b2: ; preds = %b1, %b0
22 %v2 = phi <128 x i1> [ %v1, %b1 ], [ undef, %b0 ]
25 b3: ; preds = %b3, %b2
26 %v3 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 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 <128 x i1> @llvm.hexagon.V6.vgtub.128B(<32 x i32> %v5, <32 x i32> undef) #2
30 %v7 = tail call <128 x i1> @llvm.hexagon.V6.pred.or.128B(<128 x i1> %v6, <128 x i1> undef) #2
31 %v8 = tail call <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 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}"(<128 x i1> undef, ptr undef, <32 x i32> %v8) #2
36 ; Function Attrs: nounwind readnone
37 declare <32 x i32> @llvm.hexagon.V6.vmux.128B(<128 x i1>, <32 x i32>, <32 x i32>) #1
39 ; Function Attrs: nounwind readnone
40 declare <128 x i1> @llvm.hexagon.V6.vgtub.128B(<32 x i32>, <32 x i32>) #1
42 ; Function Attrs: nounwind readnone
43 declare <128 x i1> @llvm.hexagon.V6.pred.or.128B(<128 x i1>, <128 x i1>) #1
45 ; Function Attrs: nounwind readnone
46 declare <128 x i1> @llvm.hexagon.V6.pred.not.128B(<128 x i1>) #1
48 ; Function Attrs: nounwind readnone
49 declare <32 x i32> @llvm.hexagon.V6.vor.128B(<32 x i32>, <32 x i32>) #1
51 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length128b" }
52 attributes #1 = { nounwind readnone }
53 attributes #2 = { nounwind }