1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mcpu=ppc -mtriple=powerpc64 -verify-machineinstrs < %s \
; RUN: | FileCheck %s --check-prefixes=BE64
; RUN: llc -mtriple=powerpc64le -verify-machineinstrs < %s \
; RUN: | FileCheck %s --check-prefixes=LE64
; RUN: llc -mtriple=ppc32 -verify-machineinstrs < %s \
; RUN: | FileCheck %s --check-prefixes=LE32
define void @foo(i64 %t) sspstrong nounwind {
; BE64-LABEL: foo:
; BE64: # %bb.0:
; BE64-NEXT: mflr 0
; BE64-NEXT: std 31, -8(1)
; BE64-NEXT: stdu 1, -144(1)
; BE64-NEXT: mr 31, 1
; BE64-NEXT: std 0, 160(1)
; BE64-NEXT: std 30, 128(31) # 8-byte Folded Spill
; BE64-NEXT: addis 30, 2, __stack_chk_guard@toc@ha
; BE64-NEXT: sldi 3, 3, 2
; BE64-NEXT: ld 4, __stack_chk_guard@toc@l(30)
; BE64-NEXT: addi 3, 3, 15
; BE64-NEXT: rldicr 3, 3, 0, 59
; BE64-NEXT: neg 3, 3
; BE64-NEXT: std 4, 120(31)
; BE64-NEXT: addi 4, 31, 144
; BE64-NEXT: stdux 4, 1, 3
; BE64-NEXT: addi 3, 1, 112
; BE64-NEXT: bl baz
; BE64-NEXT: nop
; BE64-NEXT: ld 3, __stack_chk_guard@toc@l(30)
; BE64-NEXT: ld 4, 120(31)
; BE64-NEXT: cmpld 3, 4
; BE64-NEXT: bne 0, .LBB0_2
; BE64-NEXT: # %bb.1:
; BE64-NEXT: ld 30, 128(31) # 8-byte Folded Reload
; BE64-NEXT: ld 1, 0(1)
; BE64-NEXT: ld 0, 16(1)
; BE64-NEXT: ld 31, -8(1)
; BE64-NEXT: mtlr 0
; BE64-NEXT: blr
; BE64-NEXT: .LBB0_2:
; BE64-NEXT: bl __stack_chk_fail
; BE64-NEXT: nop
;
; LE64-LABEL: foo:
; LE64: # %bb.0:
; LE64-NEXT: mflr 0
; LE64-NEXT: std 31, -8(1)
; LE64-NEXT: stdu 1, -64(1)
; LE64-NEXT: mr 31, 1
; LE64-NEXT: sldi 3, 3, 2
; LE64-NEXT: std 0, 80(1)
; LE64-NEXT: std 30, 48(31) # 8-byte Folded Spill
; LE64-NEXT: addis 30, 2, __stack_chk_guard@toc@ha
; LE64-NEXT: addi 3, 3, 15
; LE64-NEXT: ld 4, __stack_chk_guard@toc@l(30)
; LE64-NEXT: rldicr 3, 3, 0, 59
; LE64-NEXT: neg 3, 3
; LE64-NEXT: std 4, 40(31)
; LE64-NEXT: addi 4, 31, 64
; LE64-NEXT: stdux 4, 1, 3
; LE64-NEXT: addi 3, 1, 32
; LE64-NEXT: bl baz
; LE64-NEXT: nop
; LE64-NEXT: ld 3, __stack_chk_guard@toc@l(30)
; LE64-NEXT: ld 4, 40(31)
; LE64-NEXT: cmpld 3, 4
; LE64-NEXT: bne 0, .LBB0_2
; LE64-NEXT: # %bb.1:
; LE64-NEXT: ld 30, 48(31) # 8-byte Folded Reload
; LE64-NEXT: ld 1, 0(1)
; LE64-NEXT: ld 0, 16(1)
; LE64-NEXT: ld 31, -8(1)
; LE64-NEXT: mtlr 0
; LE64-NEXT: blr
; LE64-NEXT: .LBB0_2:
; LE64-NEXT: bl __stack_chk_fail
; LE64-NEXT: nop
;
; LE32-LABEL: foo:
; LE32: # %bb.0:
; LE32-NEXT: mflr 0
; LE32-NEXT: stwu 1, -32(1)
; LE32-NEXT: stw 31, 28(1)
; LE32-NEXT: mr 31, 1
; LE32-NEXT: stw 0, 36(1)
; LE32-NEXT: slwi 4, 4, 2
; LE32-NEXT: stw 30, 24(31) # 4-byte Folded Spill
; LE32-NEXT: lis 30, __stack_chk_guard@ha
; LE32-NEXT: lwz 3, __stack_chk_guard@l(30)
; LE32-NEXT: addi 4, 4, 15
; LE32-NEXT: rlwinm 4, 4, 0, 0, 27
; LE32-NEXT: neg 4, 4
; LE32-NEXT: stw 3, 20(31)
; LE32-NEXT: addi 3, 31, 32
; LE32-NEXT: stwux 3, 1, 4
; LE32-NEXT: addi 3, 1, 16
; LE32-NEXT: bl baz
; LE32-NEXT: lwz 3, __stack_chk_guard@l(30)
; LE32-NEXT: lwz 4, 20(31)
; LE32-NEXT: cmplw 3, 4
; LE32-NEXT: bne 0, .LBB0_2
; LE32-NEXT: # %bb.1:
; LE32-NEXT: lwz 30, 24(31) # 4-byte Folded Reload
; LE32-NEXT: lwz 31, 0(1)
; LE32-NEXT: lwz 0, -4(31)
; LE32-NEXT: mr 1, 31
; LE32-NEXT: mr 31, 0
; LE32-NEXT: lwz 0, 4(1)
; LE32-NEXT: mtlr 0
; LE32-NEXT: blr
; LE32-NEXT: .LBB0_2:
; LE32-NEXT: bl __stack_chk_fail
%vla = alloca i32, i64 %t, align 4
call void @baz(ptr %vla)
ret void
}
declare void @baz(ptr)
!llvm.module.flags = !{!1}
!1 = !{i32 2, !"stack-protector-guard", !"global"}
|