3 ; RUN: llc -march=hexagon -O3 < %s | FileCheck %s
4 ; CHECK-NOT: add(r{{[0-9]+}},#2)
5 ; CHECK-NOT: add(r{{[0-9]+}},#3)
6 ; CHECK: memub(r{{[0-9]+}}+#2)
7 ; CHECK: memub(r{{[0-9]+}}+#3)
9 @g0 = external global i32, align 4
11 define i32 @f0(i8* nocapture readonly %a0, i8* nocapture readonly %a1) {
13 %v0 = getelementptr inbounds i8, i8* %a0, i32 2
14 %v1 = getelementptr inbounds i8, i8* %a1, i32 3
18 %v2 = getelementptr inbounds i8, i8* %a0, i32 %v7
19 %v3 = add nuw nsw i32 %v7, 1
20 %v4 = getelementptr inbounds i8, i8* %a1, i32 %v3
21 %v5 = icmp eq i32 %v7, 3
22 br i1 %v5, label %b4, label %b2
24 b2: ; preds = %b1, %b0
25 %v6 = phi i8* [ %v1, %b0 ], [ %v4, %b1 ]
26 %v7 = phi i32 [ 3, %b0 ], [ %v3, %b1 ]
27 %v8 = phi i8* [ %v0, %b0 ], [ %v2, %b1 ]
30 b3: ; preds = %b3, %b2
31 %v9 = load i8, i8* %v8, align 1
32 %v10 = zext i8 %v9 to i32
33 %v11 = load i8, i8* %v6, align 1
34 %v12 = zext i8 %v11 to i32
35 %v13 = tail call i32 bitcast (i32 (...)* @f1 to i32 (i32, i32)*)(i32 %v10, i32 %v12)
36 %v14 = icmp eq i32 %v13, 0
37 br i1 %v14, label %b1, label %b3
40 %v15 = tail call i32 @f2(i8* %a0, i8* %a1)
41 %v16 = icmp sgt i32 %v15, 0
42 br i1 %v16, label %b5, label %b6
45 store i32 10, i32* @g0, align 4
48 b6: ; preds = %b5, %b4
49 %v17 = phi i32 [ 1, %b5 ], [ 0, %b4 ]
55 declare i32 @f2(i8* nocapture, i8* nocapture)