1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 target triple = "hexagon-unknown--elf"
5 ; Check that we can predicate base+offset vector stores.
7 ; CHECK: if{{.*}}vmem(r{{[0-9]+}}+#0) =
8 define void @sammy(ptr nocapture %p, ptr nocapture readonly %q, i32 %n) #0 {
10 %0 = load <16 x i32>, ptr %q, align 64
11 %sub = add nsw i32 %n, -1
14 for.body: ; preds = %if.end, %entry
15 %p.addr.011 = phi ptr [ %p, %entry ], [ %incdec.ptr, %if.end ]
16 %i.010 = phi i32 [ 0, %entry ], [ %add, %if.end ]
17 %mul = mul nsw i32 %i.010, %sub
18 %add = add nuw nsw i32 %i.010, 1
19 %mul1 = mul nsw i32 %add, %n
20 %cmp2 = icmp slt i32 %mul, %mul1
21 br i1 %cmp2, label %if.then, label %if.end
23 if.then: ; preds = %for.body
24 store <16 x i32> %0, ptr %p.addr.011, align 64
27 if.end: ; preds = %if.then, %for.body
28 %incdec.ptr = getelementptr inbounds <16 x i32>, ptr %p.addr.011, i32 1
29 %exitcond = icmp eq i32 %add, 100
30 br i1 %exitcond, label %for.end, label %for.body
32 for.end: ; preds = %if.end
36 ; Check that we can predicate post-increment vector stores.
38 ; CHECK: if{{.*}}vmem(r{{[0-9]+}}++#1) =
39 define void @danny(ptr nocapture %p, ptr nocapture readonly %q, i32 %n) #0 {
41 %0 = load <16 x i32>, ptr %q, align 64
42 %sub = add nsw i32 %n, -1
45 for.body: ; preds = %if.end, %entry
46 %p.addr.012 = phi ptr [ %p, %entry ], [ %incdec.ptr3, %if.end ]
47 %i.011 = phi i32 [ 0, %entry ], [ %add, %if.end ]
48 %mul = mul nsw i32 %i.011, %sub
49 %add = add nuw nsw i32 %i.011, 1
50 %mul1 = mul nsw i32 %add, %n
51 %cmp2 = icmp slt i32 %mul, %mul1
52 br i1 %cmp2, label %if.then, label %if.end
54 if.then: ; preds = %for.body
55 %incdec.ptr = getelementptr inbounds <16 x i32>, ptr %p.addr.012, i32 1
56 store <16 x i32> %0, ptr %p.addr.012, align 64
59 if.end: ; preds = %if.then, %for.body
60 %p.addr.1 = phi ptr [ %incdec.ptr, %if.then ], [ %p.addr.012, %for.body ]
61 %incdec.ptr3 = getelementptr inbounds <16 x i32>, ptr %p.addr.1, i32 1
62 %exitcond = icmp eq i32 %add, 100
63 br i1 %exitcond, label %for.end, label %for.body
65 for.end: ; preds = %if.end
69 attributes #0 = { norecurse nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }