Krzysztof Parzyszek | 046090d | 2018-03-12 14:01:28 +0000 | [diff] [blame] | 1 | ; 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 | |
| 9 | target triple = "hexagon" |
| 10 | |
| 11 | ; Function Attrs: nounwind |
| 12 | define void @f0() local_unnamed_addr #0 { |
| 13 | b0: |
| 14 | %v0 = icmp eq i32 undef, 0 |
| 15 | br i1 %v0, label %b1, label %b2 |
| 16 | |
| 17 | b1: ; 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 | |
| 21 | b2: ; preds = %b1, %b0 |
| 22 | %v2 = phi <1024 x i1> [ %v1, %b1 ], [ undef, %b0 ] |
| 23 | br label %b3 |
| 24 | |
| 25 | b3: ; 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 |
| 37 | declare <32 x i32> @llvm.hexagon.V6.vmux.128B(<1024 x i1>, <32 x i32>, <32 x i32>) #1 |
| 38 | |
| 39 | ; Function Attrs: nounwind readnone |
| 40 | declare <1024 x i1> @llvm.hexagon.V6.vgtub.128B(<32 x i32>, <32 x i32>) #1 |
| 41 | |
| 42 | ; Function Attrs: nounwind readnone |
| 43 | declare <1024 x i1> @llvm.hexagon.V6.pred.or.128B(<1024 x i1>, <1024 x i1>) #1 |
| 44 | |
| 45 | ; Function Attrs: nounwind readnone |
| 46 | declare <1024 x i1> @llvm.hexagon.V6.pred.not.128B(<1024 x i1>) #1 |
| 47 | |
| 48 | ; Function Attrs: nounwind readnone |
| 49 | declare <32 x i32> @llvm.hexagon.V6.vor.128B(<32 x i32>, <32 x i32>) #1 |
| 50 | |
| 51 | attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length128b" } |
| 52 | attributes #1 = { nounwind readnone } |
| 53 | attributes #2 = { nounwind } |