1 ; RUN: llc -march=hexagon -filetype=obj -o /dev/null < %s
4 ; This crashed in the MC code emitter, because a new-value branch was created
5 ; with IMPLICIT_DEF as the producer.
7 target triple = "hexagon"
9 %type.0 = type { %type.1, [64 x i8] }
10 %type.1 = type { [12 x i8], ptr, double }
11 %type.2 = type { i16, i16, [1 x %type.3] }
12 %type.3 = type { i32 }
13 %type.4 = type { ptr, i32 }
15 define hidden fastcc ptr @fred(ptr nocapture readonly %a0, ptr readonly %a1) unnamed_addr #2 {
17 %v3 = load i8, ptr %a1, align 1
18 br i1 undef, label %b4, label %b24
21 switch i8 %v3, label %b13 [
34 %v7 = getelementptr inbounds i8, ptr %a1, i32 2
41 %v10 = tail call fastcc ptr @fred(ptr undef, ptr undef)
54 br i1 undef, label %b15, label %b16
59 b16: ; preds = %b20, %b14, %b8, %b6
60 %v17 = phi ptr [ %v21, %b20 ], [ undef, %b14 ], [ undef, %b8 ], [ %v7, %b6 ]
61 %v18 = phi i32 [ 0, %b20 ], [ undef, %b14 ], [ 0, %b8 ], [ 8, %b6 ]
62 %v19 = icmp sgt i32 %v18, 0
63 br i1 %v19, label %b20, label %b24
66 %v21 = getelementptr inbounds i8, ptr %v17, i32 1
67 %v22 = load i8, ptr %v17, align 1
68 %v23 = icmp eq i8 %v22, undef
69 br i1 %v23, label %b16, label %b24
71 b24: ; preds = %b20, %b16, %b9, %b2
72 %v25 = phi ptr [ null, %b2 ], [ null, %b9 ], [ %v17, %b16 ], [ null, %b20 ]
76 attributes #0 = { argmemonly nounwind }
77 attributes #1 = { nounwind readonly "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length64b,-long-calls" }
78 attributes #2 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length64b,-long-calls" }