1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -o - %s -mtriple=aarch64 -run-pass=machine-scheduler -verify-machineinstrs | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64"
7 @a = dso_local global i32 2, align 4
8 @b = dso_local global i32 4, align 4
10 define i32 @fuseaddress(i32 %num) #0 {
12 %0 = load i32, ptr @a, align 4
13 %1 = load i32, ptr @b, align 4
14 %mul = mul nsw i32 %0, %1
18 attributes #0 = { "target-cpu"="cortex-a55" }
24 tracksRegLiveness: true
30 ; CHECK-LABEL: name: fuseaddress
32 ; CHECK: [[ADRP:%[0-9]+]]:gpr64common = ADRP target-flags(aarch64-page) @a
33 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32 = LDRWui [[ADRP]], target-flags(aarch64-pageoff, aarch64-nc) @a :: (dereferenceable load (s32) from @a)
34 ; CHECK: [[ADRP1:%[0-9]+]]:gpr64common = ADRP target-flags(aarch64-page) @b
35 ; CHECK: [[LDRWui1:%[0-9]+]]:gpr32 = LDRWui [[ADRP1]], target-flags(aarch64-pageoff, aarch64-nc) @b :: (dereferenceable load (s32) from @b)
36 ; CHECK: [[MADDWrrr:%[0-9]+]]:gpr32 = nsw MADDWrrr [[LDRWui]], [[LDRWui1]], $wzr
37 ; CHECK: $w0 = COPY [[MADDWrrr]]
38 ; CHECK: RET_ReallyLR implicit $w0
39 %1:gpr64common = ADRP target-flags(aarch64-page) @a
40 %4:gpr64common = ADRP target-flags(aarch64-page) @b
41 %2:gpr32 = LDRWui killed %1:gpr64common, target-flags(aarch64-pageoff, aarch64-nc) @a :: (dereferenceable load (s32) from @a)
42 %5:gpr32 = LDRWui killed %4:gpr64common, target-flags(aarch64-pageoff, aarch64-nc) @b :: (dereferenceable load (s32) from @b)
43 %6:gpr32 = nsw MADDWrrr killed %2:gpr32, killed %5:gpr32, $wzr
45 RET_ReallyLR implicit $w0