78 lines · plain
1; RUN: llc -verify-machineinstrs -enable-machine-outliner %s -o - | FileCheck %s2; RUN: llc -verify-machineinstrs -enable-machine-outliner -aarch64-redzone %s -o - | FileCheck %s -check-prefix=REDZONE3 4; Ensure that the MachineOutliner does not fire on functions which use a5; redzone. We don't care about what's actually outlined here. We just want to6; force behaviour in the outliner to make sure that it never acts on anything7; that might have a redzone.8target triple = "arm64----"9 10@x = common global i32 0, align 411declare void @baz() #012 13; In AArch64FrameLowering, there are a couple special early exit cases where we14; *know* we don't use a redzone. The GHC calling convention is one of these15; cases. Make sure that we know we don't have a redzone even in these cases.16define cc 10 void @bar() #0 {17 ; CHECK-LABEL: bar18 ; CHECK: bl OUTLINED_FUNCTION19 ; REDZONE-LABEL: bar20 ; REDZONE: bl OUTLINED_FUNCTION21 %1 = load i32, ptr @x, align 422 %2 = add nsw i32 %1, 123 store i32 %2, ptr @x, align 424 call void @baz()25 %3 = load i32, ptr @x, align 426 %4 = add nsw i32 %3, 127 store i32 %4, ptr @x, align 428 call void @baz()29 %5 = load i32, ptr @x, align 430 %6 = add nsw i32 %5, 131 store i32 %6, ptr @x, align 432 ret void33}34 35; foo() should have a redzone when compiled with -aarch64-redzone, and no36; redzone otherwise.37define void @foo() #0 {38 ; CHECK-LABEL: foo39 ; CHECK: bl OUTLINED_FUNCTION40 ; REDZONE-LABEL: foo41 ; REDZONE-NOT: bl OUTLINED_FUNCTION42 %1 = alloca i32, align 443 %2 = alloca i32, align 444 %3 = alloca i32, align 445 %4 = alloca i32, align 446 store i32 0, ptr %1, align 447 store i32 0, ptr %2, align 448 store i32 0, ptr %3, align 449 store i32 0, ptr %4, align 450 %5 = load i32, ptr %1, align 451 %6 = add nsw i32 %5, 152 store i32 %6, ptr %1, align 453 %7 = load i32, ptr %3, align 454 %8 = add nsw i32 %7, 155 store i32 %8, ptr %3, align 456 %9 = load i32, ptr %4, align 457 %10 = add nsw i32 %9, 158 store i32 %10, ptr %4, align 459 %11 = load i32, ptr %2, align 460 %12 = add nsw i32 %11, 161 store i32 %12, ptr %2, align 462 %13 = load i32, ptr %1, align 463 %14 = add nsw i32 %13, 164 store i32 %14, ptr %1, align 465 %15 = load i32, ptr %3, align 466 %16 = add nsw i32 %15, 167 store i32 %16, ptr %3, align 468 %17 = load i32, ptr %4, align 469 %18 = add nsw i32 %17, 170 store i32 %18, ptr %4, align 471 %19 = load i32, ptr %2, align 472 %20 = add nsw i32 %19, -173 store i32 %20, ptr %2, align 474 ret void75}76 77attributes #0 = { noinline nounwind optnone }78