1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -verify-machineinstrs < %s | FileCheck %s
4 %struct.foo = type { i32, i64, float, double }
6 define ptr @test_struct(ptr %f) {
7 ; CHECK-LABEL: test_struct:
9 ; CHECK-NEXT: add x0, x0, #24
11 %1 = getelementptr inbounds %struct.foo, ptr %f, i64 0, i32 3
15 define ptr @test_array1(ptr %a, i64 %i) {
16 ; CHECK-LABEL: test_array1:
18 ; CHECK-NEXT: mov x8, #4 ; =0x4
19 ; CHECK-NEXT: madd x0, x1, x8, x0
21 %1 = getelementptr inbounds i32, ptr %a, i64 %i
25 define ptr @test_array2(ptr %a) {
26 ; CHECK-LABEL: test_array2:
28 ; CHECK-NEXT: add x0, x0, #16
30 %1 = getelementptr inbounds i32, ptr %a, i64 4
34 define ptr @test_array3(ptr %a) {
35 ; CHECK-LABEL: test_array3:
37 ; CHECK-NEXT: add x0, x0, #1, lsl #12 ; =4096
39 %1 = getelementptr inbounds i32, ptr %a, i64 1024
43 define ptr @test_array4(ptr %a) {
44 ; CHECK-LABEL: test_array4:
46 ; CHECK-NEXT: mov x8, #4104 ; =0x1008
47 ; CHECK-NEXT: add x0, x0, x8
49 %1 = getelementptr inbounds i32, ptr %a, i64 1026
53 define ptr @test_array5(ptr %a, i32 %i) {
54 ; CHECK-LABEL: test_array5:
56 ; CHECK-NEXT: ; kill: def $w1 killed $w1 def $x1
57 ; CHECK-NEXT: sxtw x8, w1
58 ; CHECK-NEXT: mov x9, #4 ; =0x4
59 ; CHECK-NEXT: madd x0, x8, x9, x0
61 %1 = getelementptr inbounds i32, ptr %a, i32 %i