1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
2 # RUN: llc -run-pass=machine-scheduler %s -o - | FileCheck %s
5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64"
8 define i32 @test_add(ptr %0) #0 {
9 %2 = ptrtoint ptr %0 to i64
11 %4 = inttoptr i64 %3 to ptr
12 %5 = load i32, ptr %4, align 64
13 %6 = getelementptr inbounds i32, ptr %4, i64 1
14 %7 = load i32, ptr %6, align 4
15 %8 = add nsw i32 %7, %5
19 attributes #0 = { "target-cpu"="ampere1" }
24 tracksRegLiveness: true
26 - { id: 0, class: gpr64, preferred-register: '' }
27 - { id: 1, class: gpr64sp, preferred-register: '' }
28 - { id: 2, class: gpr32, preferred-register: '' }
29 - { id: 3, class: gpr32, preferred-register: '' }
30 - { id: 4, class: gpr32, preferred-register: '' }
32 - { reg: '$x0', virtual-reg: '%0' }
37 ; CHECK-LABEL: name: test_add
40 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
41 ; CHECK-NEXT: [[ANDXri:%[0-9]+]]:gpr64sp = ANDXri [[COPY]], 7865
42 ; CHECK-NEXT: [[LDRWui:%[0-9]+]]:gpr32 = LDRWui [[ANDXri]], 0 :: (load (s32) from %ir.4, align 64)
43 ; CHECK-NEXT: [[LDRWui1:%[0-9]+]]:gpr32 = LDRWui [[ANDXri]], 1 :: (load (s32) from %ir.6)
44 ; CHECK-NEXT: [[ADDWrr:%[0-9]+]]:gpr32 = nsw ADDWrr [[LDRWui1]], [[LDRWui]]
45 ; CHECK-NEXT: $w0 = COPY [[ADDWrr]]
46 ; CHECK-NEXT: RET_ReallyLR implicit $w0
48 %1:gpr64sp = ANDXri %0, 7865
49 %2:gpr32 = LDRWui %1, 0 :: (load (s32) from %ir.4, align 64)
50 %3:gpr32 = LDRWui %1, 1 :: (load (s32) from %ir.6)
51 %4:gpr32 = nsw ADDWrr %3, %2
53 RET_ReallyLR implicit $w0