brintos

brintos / llvm-project-archived public Read only

0
0
Text · 10.1 KiB · 22e5ede Raw
207 lines · plain
1# RUN: llc -verify-machineinstrs -run-pass=machine-outliner -run-pass=aarch64-ptrauth -outliner-leaf-descendants=false %s -o - | FileCheck %s2 3--- |4  target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"5  target triple = "aarch64-arm-linux-gnu"6 7  @v = common dso_local global ptr null, align 88 9  ; Function Attrs: nounwind10  define dso_local void @legal0() #0 {11    %1 = alloca i32, align 412    store volatile ptr %1, ptr @v, align 813    store volatile ptr %1, ptr @v, align 814    store volatile ptr %1, ptr @v, align 815    store volatile ptr %1, ptr @v, align 816    store volatile ptr %1, ptr @v, align 817    store volatile ptr %1, ptr @v, align 818    store volatile ptr %1, ptr @v, align 819    ret void20  }21 22  ; Function Attrs: nounwind23  define dso_local void @legal1() #0 {24    %1 = alloca i32, align 425    store volatile ptr %1, ptr @v, align 826    store volatile ptr %1, ptr @v, align 827    store volatile ptr %1, ptr @v, align 828    store volatile ptr %1, ptr @v, align 829    store volatile ptr %1, ptr @v, align 830    store volatile ptr %1, ptr @v, align 831    store volatile ptr %1, ptr @v, align 832    ret void33  }34 35  ; Function Attrs: nounwind36  define dso_local void @illegal0() #0 {37    %1 = alloca i32, align 438    store volatile ptr %1, ptr @v, align 839    store volatile ptr %1, ptr @v, align 840    store volatile ptr %1, ptr @v, align 841    store volatile ptr %1, ptr @v, align 842    store volatile ptr %1, ptr @v, align 843    store volatile ptr %1, ptr @v, align 844    store volatile ptr %1, ptr @v, align 845    ret void46  }47 48  ; Function Attrs: nounwind49  define dso_local void @illegal1() #0 {50    %1 = alloca i32, align 451    store volatile ptr %1, ptr @v, align 852    store volatile ptr %1, ptr @v, align 853    store volatile ptr %1, ptr @v, align 854    store volatile ptr %1, ptr @v, align 855    store volatile ptr %1, ptr @v, align 856    store volatile ptr %1, ptr @v, align 857    store volatile ptr %1, ptr @v, align 858    ret void59  }60 61  attributes #0 = { nounwind uwtable "sign-return-address"="all" "sign-return-address-key"="a_key" noinline noredzone "frame-pointer"="all" }62 63...64---65name:            legal066tracksRegLiveness: true67body:             |68  bb.0 (%ir-block.0):69  liveins: $lr70    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp71    $sp = frame-setup SUBXri $sp, 16, 072    renamable $x8 = ADRP target-flags(aarch64-page) @v73    $x9 = ADDXri $sp, 12, 074    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)75    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)76    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)77    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)78    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)79    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)80    STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)81    $sp = frame-destroy ADDXri $sp, 16, 082    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp83    RET undef $lr84 85# CHECK-LABEL:    name:            legal086# CHECK:          body:             |87# CHECK-NEXT:         bb.0 (%ir-block.0):88# CHECK-NEXT:           liveins: $lr89# CHECK:                frame-setup PACIASP implicit-def $lr, implicit $lr, implicit $sp90# CHECK-NEXT:           frame-setup CFI_INSTRUCTION negate_ra_sign_state91# CHECK:                BL @[[OUTLINED_FUNC:OUTLINED_FUNCTION_[0-9]+]]92# CHECK:                frame-destroy AUTIASP implicit-def $lr, implicit $lr, implicit $sp93# CHECK-NEXT:           frame-destroy CFI_INSTRUCTION negate_ra_sign_state94# CHECK-NEXT:           RET undef $lr95 96...97---98name:            legal199tracksRegLiveness: true100body:             |101  bb.0 (%ir-block.0):102  liveins: $lr103    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp104    $sp = frame-setup SUBXri $sp, 16, 0105    renamable $x8 = ADRP target-flags(aarch64-page) @v106    $x9 = ADDXri $sp, 12, 0107    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)108    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)109    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)110    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)111    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)112    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)113    STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)114    $sp = frame-destroy ADDXri $sp, 16, 0115    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp116    RET undef $lr117 118# CHECK-LABEL:    name:            legal1119# CHECK:          body:             |120# CHECK-NEXT:         bb.0 (%ir-block.0):121# CHECK-NEXT:           liveins: $lr122# CHECK:                frame-setup PACIASP implicit-def $lr, implicit $lr, implicit $sp123# CHECK-NEXT:           frame-setup CFI_INSTRUCTION negate_ra_sign_state124# CHECK:                BL @[[OUTLINED_FUNC]]125# CHECK:                frame-destroy AUTIASP implicit-def $lr, implicit $lr, implicit $sp126# CHECK-NEXT:           frame-destroy CFI_INSTRUCTION negate_ra_sign_state127# CHECK-NEXT:           RET undef $lr128 129...130---131name:            illegal0132tracksRegLiveness: true133body:             |134  bb.0 (%ir-block.0):135  liveins: $lr136    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp137    $sp = frame-setup SUBXri $sp, 16, 0138    renamable $x8 = ADRP target-flags(aarch64-page) @v139    $x9 = ADDXri $sp, 12, 0140    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)141    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)142    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)143    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)144    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)145    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)146    STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)147    $sp = frame-destroy ADDXri $sp, 12, 0148    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp149    RET undef $lr150 151...152---153name:            illegal1154tracksRegLiveness: true155body:             |156  bb.0 (%ir-block.0):157  liveins: $lr158    frame-setup PAUTH_PROLOGUE implicit-def $lr, implicit $lr, implicit $sp159    $sp = frame-setup SUBXri $sp, 16, 0160    renamable $x8 = ADRP target-flags(aarch64-page) @v161    $x9 = ADDXri $sp, 12, 0162    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)163    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)164    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)165    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)166    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)167    STRXui renamable $x9, renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)168    STRXui killed renamable $x9, killed renamable $x8, target-flags(aarch64-pageoff, aarch64-nc) @v :: (volatile store (s64) into @v)169    $sp = frame-destroy ADDXri $sp, 12, 0170    frame-destroy PAUTH_EPILOGUE implicit-def $lr, implicit $lr, implicit $sp171    RET undef $lr172 173# CHECK-LABEL:    name:            illegal0174# CHECK:          body:             |175# CHECK-NEXT:         bb.0 (%ir-block.0):176# CHECK-NEXT:           liveins: $lr177# CHECK:                frame-setup PACIASP implicit-def $lr, implicit $lr, implicit $sp178# CHECK-NEXT:           frame-setup CFI_INSTRUCTION negate_ra_sign_state179# CHECK-NOT:            BL @OUTLINED_FUNCTION_{{.*}}180# CHECK:                frame-destroy AUTIASP implicit-def $lr, implicit $lr, implicit $sp181# CHECK-NEXT:           frame-destroy CFI_INSTRUCTION negate_ra_sign_state182# CHECK-NEXT:           RET undef $lr183 184# CHECK-LABEL:    name:            illegal1185# CHECK:          body:             |186# CHECK-NEXT:         bb.0 (%ir-block.0):187# CHECK-NEXT:           liveins: $lr188# CHECK:                frame-setup PACIASP implicit-def $lr, implicit $lr, implicit $sp189# CHECK-NEXT:           frame-setup CFI_INSTRUCTION negate_ra_sign_state190# CHECK-NOT:            BL @OUTLINED_FUNCTION_{{.*}}191# CHECK:                frame-destroy AUTIASP implicit-def $lr, implicit $lr, implicit $sp192# CHECK-NEXT:           frame-destroy CFI_INSTRUCTION negate_ra_sign_state193# CHECK-NEXT:           RET undef $lr194 195# Outlined function that contains only legal sp modifications196# CHECK:          name:            [[OUTLINED_FUNC]]197# CHECK:          body:             |198# CHECK-NEXT:       bb.0:199# CHECK-NEXT: liveins: $lr200# CHECK-NEXT: {{^  $}}201# CHECK-NEXT:         frame-setup PACIASP implicit-def $lr, implicit $lr, implicit $sp202# CHECK-NEXT:         frame-setup CFI_INSTRUCTION negate_ra_sign_state203# CHECK-NEXT:         $sp = frame-setup SUBXri $sp, 16, 0204# CHECK:              $sp = frame-destroy ADDXri $sp, 16, 0205# CHECK-NEXT:         frame-destroy AUTIASP implicit-def $lr, implicit $lr, implicit $sp206# CHECK-NEXT:         RET $lr207