1; RUN: llc -march=hexagon < %s | FileCheck %s
2;
3; Test whether we can produce minimal code for this complex address
4; calculation.
5;
6
7; CHECK: r0 = memub(r{{[0-9]+}}<<#3+##the_global+516)
8
9%0 = type { [3 x %1] }
10%1 = type { %2, i8, i8, i8, i8, i8, [4 x i8], i8, [10 x i8], [10 x i8], [10 x i8], i8, [3 x %4], i16, i16, i16, i16, i32, i8, [4 x i8], i8, i8, i8, i8, %5, i8, i8, i8, i8, i8, i16, i8, i8, i8, i16, i16, i8, i8, [2 x i8], [2 x i8], i8, i8, i8, i8, i8, i16, i16, i8, i8, i8, i8, i8, i8, %9, i8, [6 x [2 x i8]], i16, i32, %10, [28 x i8], [4 x %17] }
11%2 = type { %3 }
12%3 = type { i8, i8, i8, i8, i8, i16, i16, i16, i16, i16 }
13%4 = type { i16, i16 }
14%5 = type { [10 x %6] }
15%6 = type { [2 x %7] }
16%7 = type { i8, [2 x %8] }
17%8 = type { [4 x i8] }
18%9 = type { i8 }
19%10 = type { %11, %13 }
20%11 = type { [2 x [2 x i8]], [2 x [8 x %12]], [6 x i16], [6 x i16] }
21%12 = type { i8, i8 }
22%13 = type { [4 x %12], [4 x %12], [2 x [4 x %14]], [6 x i16] }
23%14 = type { %15, %16 }
24%15 = type { i8, i8 }
25%16 = type { i8, i8 }
26%17 = type { i8, i8, %1*, i16, i16, i16, i64, i32, i32, %18, i8, %21, i8, [2 x i16], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i8, i8, i8, i16, i16, [2 x i16], i16, [2 x i32], [2 x i16], [2 x i16], i8, i8, [6 x %23], i8, i8, i8, %24, %25, %26, %28 }
27%18 = type { %19, [10 x %20] }
28%19 = type { i32 }
29%20 = type { [2 x i8], [2 x i8], i8, i8, i8, i8 }
30%21 = type { i8, i8, i8, [8 x %22] }
31%22 = type { i8, i8, i8, i32 }
32%23 = type { i32, i16, i16, [2 x i16], [2 x i16], [2 x i16], i32 }
33%24 = type { [2 x i32], [2 x i64*], [2 x i64*], [2 x i64*], [2 x i32], [2 x i32], i32 }
34%25 = type { [2 x i32], [2 x i32], [2 x i32] }
35%26 = type { i8, i8, i8, i16, i16, %27, i32, i32, i32, i16 }
36%27 = type { i64 }
37%28 = type { %29, %31, [24 x i8] }
38%29 = type { [2 x %30], [16 x i32] }
39%30 = type { [16 x i32], [8 x i32], [16 x i32], [64 x i32], [2 x i32], i64, i32, i32, i32, i32 }
40%31 = type { [2 x %32] }
41%32 = type { [4 x %33], i32 }
42%33 = type { i32, i32 }
43
44@the_global = external global %0
45
46; Function Attrs: nounwind optsize readonly ssp
47define zeroext i8 @myFun(i8 zeroext, i8 zeroext) {
48  %3 = zext i8 %1 to i32
49  %4 = zext i8 %0 to i32
50  %5 = getelementptr inbounds %0, %0* @the_global, i32 0, i32 0, i32 %4, i32 60, i32 0, i32 9, i32 1, i32 %3, i32 0, i32 0
51  %6 = load i8, i8* %5, align 4
52  ret i8 %6
53}
54
55