1 ; RUN: llc -mtriple=hexagon -enable-pipeliner -pipeliner-max-stages=2 < %s
4 ; Test that the compiler doesn't seg fault due to incorrect names in epilog.
6 ; Function Attrs: nounwind
7 define void @f0(ptr nocapture %a0, ptr nocapture %a1, i16 signext %a2) #0 {
9 %v0 = icmp sgt i16 %a2, 0
10 br i1 %v0, label %b1, label %b3
13 %v1 = sext i16 %a2 to i32
16 b2: ; preds = %b2, %b1
17 %v2 = phi i16 [ %v16, %b2 ], [ undef, %b1 ]
18 %v3 = phi i32 [ %v17, %b2 ], [ 0, %b1 ]
19 %v4 = phi ptr [ undef, %b2 ], [ %a0, %b1 ]
20 %v5 = phi ptr [ %v6, %b2 ], [ %a1, %b1 ]
21 %v6 = getelementptr inbounds i16, ptr %v5, i32 1
22 %v7 = load i16, ptr %v5, align 2, !tbaa !0
23 %v8 = sext i16 %v7 to i32
24 %v9 = tail call i32 @llvm.hexagon.A2.aslh(i32 %v8)
25 %v10 = tail call i32 @llvm.hexagon.S2.asr.r.r.sat(i32 %v9, i32 undef)
26 %v11 = sext i16 %v2 to i32
27 %v12 = tail call i32 @llvm.hexagon.M2.mpy.nac.sat.ll.s1(i32 %v10, i32 %v11, i32 undef)
28 %v13 = tail call i32 @llvm.hexagon.S2.asl.r.r.sat(i32 %v12, i32 undef)
29 %v14 = tail call i32 @llvm.hexagon.A2.addsat(i32 %v13, i32 32768)
30 %v15 = tail call i32 @llvm.hexagon.A2.asrh(i32 %v14)
31 %v16 = trunc i32 %v15 to i16
32 store i16 %v16, ptr %v4, align 2, !tbaa !0
34 %v18 = icmp eq i32 %v17, %v1
35 br i1 %v18, label %b3, label %b2
37 b3: ; preds = %b2, %b0
41 ; Function Attrs: nounwind readnone
42 declare i32 @llvm.hexagon.A2.aslh(i32) #1
44 ; Function Attrs: nounwind readnone
45 declare i32 @llvm.hexagon.S2.asr.r.r.sat(i32, i32) #1
47 ; Function Attrs: nounwind readnone
48 declare i32 @llvm.hexagon.M2.mpy.nac.sat.ll.s1(i32, i32, i32) #1
50 ; Function Attrs: nounwind readnone
51 declare i32 @llvm.hexagon.S2.asl.r.r.sat(i32, i32) #1
53 ; Function Attrs: nounwind readnone
54 declare i32 @llvm.hexagon.A2.asrh(i32) #1
56 ; Function Attrs: nounwind readnone
57 declare i32 @llvm.hexagon.A2.addsat(i32, i32) #1
59 attributes #0 = { nounwind "target-cpu"="hexagonv55" }
60 attributes #1 = { nounwind readnone }
64 !2 = !{!"omnipotent char", !3}
65 !3 = !{!"Simple C/C++ TBAA"}