55 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=arm64-apple-ios -relocation-model=pic -frame-pointer=all | FileCheck %s3 4@__stack_chk_guard = external global ptr5 6; PR205587 8; Load the stack guard for the second time, just in case the previous value gets spilled.9define i32 @test_stack_guard_remat2() ssp {10; CHECK-LABEL: test_stack_guard_remat2:11; CHECK: ; %bb.0: ; %entry12; CHECK-NEXT: sub sp, sp, #6413; CHECK-NEXT: stp x29, x30, [sp, #48] ; 16-byte Folded Spill14; CHECK-NEXT: add x29, sp, #4815; CHECK-NEXT: .cfi_def_cfa w29, 1616; CHECK-NEXT: .cfi_offset w30, -817; CHECK-NEXT: .cfi_offset w29, -1618; CHECK-NEXT: Lloh0:19; CHECK-NEXT: adrp x8, ___stack_chk_guard@GOTPAGE20; CHECK-NEXT: Lloh1:21; CHECK-NEXT: adrp x9, ___stack_chk_guard@GOTPAGE22; CHECK-NEXT: Lloh2:23; CHECK-NEXT: ldr x8, [x8, ___stack_chk_guard@GOTPAGEOFF]24; CHECK-NEXT: Lloh3:25; CHECK-NEXT: ldr x9, [x9, ___stack_chk_guard@GOTPAGEOFF]26; CHECK-NEXT: Lloh4:27; CHECK-NEXT: ldr x8, [x8]28; CHECK-NEXT: Lloh5:29; CHECK-NEXT: ldr x9, [x9]30; CHECK-NEXT: str x8, [sp]31; CHECK-NEXT: stur x9, [x29, #-8]32; CHECK-NEXT: ldur x9, [x29, #-8]33; CHECK-NEXT: cmp x8, x934; CHECK-NEXT: b.ne LBB0_235; CHECK-NEXT: ; %bb.1: ; %entry36; CHECK-NEXT: ldp x29, x30, [sp, #48] ; 16-byte Folded Reload37; CHECK-NEXT: mov w0, #-138; CHECK-NEXT: add sp, sp, #6439; CHECK-NEXT: ret40; CHECK-NEXT: LBB0_2: ; %entry41; CHECK-NEXT: bl ___stack_chk_fail42; CHECK-NEXT: .loh AdrpLdrGotLdr Lloh1, Lloh3, Lloh543; CHECK-NEXT: .loh AdrpLdrGotLdr Lloh0, Lloh2, Lloh444entry:45 %StackGuardSlot = alloca ptr46 %StackGuard = load ptr, ptr @__stack_chk_guard47 call void @llvm.stackprotector(ptr %StackGuard, ptr %StackGuardSlot)48 %container = alloca [32 x i8], align 149 call void @llvm.stackprotectorcheck(ptr @__stack_chk_guard)50 ret i32 -151}52 53declare void @llvm.stackprotector(ptr, ptr) ssp54declare void @llvm.stackprotectorcheck(ptr) ssp55