1 ; RUN: llc -march=hexagon -hexagon-hwloop-preheader < %s | FileCheck %s
3 ; check for lack of assertion failures.
7 ; Function Attrs: nounwind readnone
8 declare i32 @llvm.hexagon.A2.sath(i32) #0
10 ; Function Attrs: nounwind readnone
11 declare i32 @llvm.hexagon.A2.neg(i32) #0
13 define void @f0(i16 signext %a0) {
15 %v0 = icmp slt i16 %a0, 1
16 br i1 %v0, label %b1, label %b3
18 b1: ; preds = %b2, %b0
19 %v1 = phi i16 [ %v11, %b2 ], [ %a0, %b0 ]
20 %v2 = sext i16 %v1 to i32
21 %v3 = tail call i32 @llvm.hexagon.A2.neg(i32 %v2)
22 %v4 = tail call i32 @llvm.hexagon.A2.sath(i32 %v3)
23 %v5 = trunc i32 %v4 to i16
25 %v7 = ashr exact i32 %v6, 16
26 %v8 = icmp slt i16 %v5, 0
27 br i1 %v8, label %b2, label %b3
30 %v9 = tail call i32 @llvm.hexagon.A2.neg(i32 %v7)
31 %v10 = tail call i32 @llvm.hexagon.A2.sath(i32 %v9)
32 %v11 = trunc i32 %v10 to i16
33 %v12 = icmp slt i16 %v11, 1
34 br i1 %v12, label %b1, label %b3
36 b3: ; preds = %b2, %b1, %b0
40 attributes #0 = { nounwind readnone }