1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; CHECK-NOT: cmpb.eq(r{{[0-9]+}},#-1)
4 target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
5 target triple = "hexagon"
7 %struct.wms_address_s = type { i32, i32, i32, i32, i8, [48 x i8] }
9 define zeroext i8 @qmi_wmsi_bin_to_addr(ptr %str, i8 zeroext %len, ptr %addr) nounwind optsize {
11 %cmp = icmp eq ptr %str, null
12 %cmp2 = icmp eq ptr %addr, null
13 %or.cond = or i1 %cmp, %cmp2
14 br i1 %or.cond, label %if.then12, label %if.then
16 if.then: ; preds = %entry
17 %dec = add i8 %len, -1
18 %cmp3 = icmp ugt i8 %dec, 24
19 %tobool27 = icmp eq i8 %dec, 0
20 %or.cond31 = or i1 %cmp3, %tobool27
21 br i1 %or.cond31, label %if.then12, label %for.body.lr.ph
23 for.body.lr.ph: ; preds = %if.then
24 %dec626 = add i8 %len, -2
27 for.body: ; preds = %for.body.lr.ph, %if.end21
28 %indvars.iv = phi i32 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end21 ]
29 %dec630 = phi i8 [ %dec626, %for.body.lr.ph ], [ %dec6, %if.end21 ]
30 %str.pn = phi ptr [ %str, %for.body.lr.ph ], [ %str.addr.029, %if.end21 ]
31 %str.addr.029 = getelementptr inbounds i8, ptr %str.pn, i32 1
32 %0 = load i8, ptr %str.addr.029, align 1, !tbaa !0
33 %cmp10 = icmp ugt i8 %0, -49
34 br i1 %cmp10, label %if.then12.loopexit, label %if.end21
36 if.then12.loopexit: ; preds = %if.end21, %for.body
39 if.then12: ; preds = %if.then12.loopexit, %if.then, %entry
42 if.end21: ; preds = %for.body
43 %shr24 = lshr i8 %0, 4
44 %arrayidx = getelementptr inbounds %struct.wms_address_s, ptr %addr, i32 0, i32 5, i32 %indvars.iv
45 store i8 %shr24, ptr %arrayidx, align 1, !tbaa !0
46 %dec6 = add i8 %dec630, -1
47 %tobool = icmp eq i8 %dec630, 0
48 %indvars.iv.next = add i32 %indvars.iv, 1
49 br i1 %tobool, label %if.then12.loopexit, label %for.body
52 !0 = !{!"omnipotent char", !1}
53 !1 = !{!"Simple C/C++ TBAA"}