brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 72d7545 Raw
70 lines · plain
1; RUN: llc -enable-machine-outliner -mtriple=x86_64-apple-darwin < %s | FileCheck %s2; Ensure that the outliner doesn't outline from any functions that use a redzone.3 4declare ptr @llvm.stacksave() #15declare void @llvm.stackrestore(ptr) #16 7; This function has a red zone. We shouldn't outline from it.8; CHECK-LABEL: doggo9; CHECK-NOT: OUTLINED10define void @doggo(i32) #0 {11  %2 = alloca i32, align 412  store i32 %0, ptr %2, align 413  %3 = load i32, ptr %2, align 414  %4 = add nsw i32 %3, 115  store i32 %4, ptr %2, align 416  ret void17}18 19; Ditto.20; CHECK-LABEL: pupper21; CHECK-NOT: OUTLINED22define void @pupper(i32) #0 {23  %2 = alloca i32, align 424  store i32 %0, ptr %2, align 425  %3 = load i32, ptr %2, align 426  %4 = add nsw i32 %3, 127  store i32 %4, ptr %2, align 428  ret void29}30 31; This doesn't have a redzone. Outlining is okay.32; CHECK-LABEL: boofer33; CHECK: OUTLINED34define void @boofer(i32) #0 {35  %2 = alloca i32, align 436  %3 = alloca ptr, align 837  %4 = alloca i64, align 838  store i32 %0, ptr %2, align 439  %5 = load i32, ptr %2, align 440  %6 = zext i32 %5 to i6441  %7 = call ptr @llvm.stacksave()42  store ptr %7, ptr %3, align 843  %8 = alloca i32, i64 %6, align 1644  store i64 %6, ptr %4, align 845  %9 = load ptr, ptr %3, align 846  call void @llvm.stackrestore(ptr %9)47  ret void48}49 50; Ditto.51; CHECK-LABEL: shibe52; CHECK: OUTLINED53define void @shibe(i32) #0 {54  %2 = alloca i32, align 455  %3 = alloca ptr, align 856  %4 = alloca i64, align 857  store i32 %0, ptr %2, align 458  %5 = load i32, ptr %2, align 459  %6 = zext i32 %5 to i6460  %7 = call ptr @llvm.stacksave()61  store ptr %7, ptr %3, align 862  %8 = alloca i32, i64 %6, align 1663  store i64 %6, ptr %4, align 864  %9 = load ptr, ptr %3, align 865  call void @llvm.stackrestore(ptr %9)66  ret void67}68 69attributes #0 = { noinline nounwind optnone ssp uwtable "frame-pointer"="all" }70attributes #1 = { nounwind }