Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/ipra-local-linkage-2.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

153 lines
4.3 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc --mtriple=x86_64-- < %s | FileCheck --check-prefix=X64 %s
; RUN: llc --mtriple=i386-- < %s | FileCheck --check-prefix=X86 %s
; This test is to ensure rbp/rbx/ebp/esi is correctly saved/restored before clobbered when enable ipra.
define internal void @callee_clobber_rbp() nounwind norecurse {
; X64-LABEL: callee_clobber_rbp:
; X64: # %bb.0:
; X64-NEXT: pushq %rbp
; X64-NEXT: #APP
; X64-NEXT: xorl %ebp, %ebp
; X64-NEXT: #NO_APP
; X64-NEXT: popq %rbp
; X64-NEXT: retq
;
; X86-LABEL: callee_clobber_rbp:
; X86: # %bb.0:
; X86-NEXT: pushl %ebp
; X86-NEXT: #APP
; X86-NEXT: xorl %ebp, %ebp
; X86-NEXT: #NO_APP
; X86-NEXT: popl %ebp
; X86-NEXT: retl
call void asm sideeffect "xor %ebp, %ebp", "~{ebp}"()
ret void
}
define internal void @callee_clobber_rbx(ptr %addr) nounwind norecurse {
; X64-LABEL: callee_clobber_rbx:
; X64: # %bb.0:
; X64-NEXT: pushq %rbx
; X64-NEXT: #APP
; X64-NEXT: xorl %ebx, %ebx
; X64-NEXT: #NO_APP
; X64-NEXT: popq %rbx
; X64-NEXT: retq
call void asm sideeffect "xor %ebx, %ebx", "~{ebx}"()
ret void
}
define internal void @callee_clobber_esi(ptr %addr) nounwind norecurse {
; X86-LABEL: callee_clobber_esi:
; X86: # %bb.0:
; X86-NEXT: pushl %esi
; X86-NEXT: #APP
; X86-NEXT: xorl %esi, %esi
; X86-NEXT: #NO_APP
; X86-NEXT: popl %esi
; X86-NEXT: retl
call void asm sideeffect "xor %esi, %esi", "~{esi}"()
ret void
}
define void @caller_use_rbp() "frame-pointer"="all" nounwind {
; X64-LABEL: caller_use_rbp:
; X64: # %bb.0:
; X64-NEXT: pushq %rbp
; X64-NEXT: movq %rsp, %rbp
; X64-NEXT: subq $16, %rsp
; X64-NEXT: callq callee_clobber_rbp
; X64-NEXT: movl $5, -4(%rbp)
; X64-NEXT: addq $16, %rsp
; X64-NEXT: popq %rbp
; X64-NEXT: retq
;
; X86-LABEL: caller_use_rbp:
; X86: # %bb.0:
; X86-NEXT: pushl %ebp
; X86-NEXT: movl %esp, %ebp
; X86-NEXT: pushl %eax
; X86-NEXT: calll callee_clobber_rbp
; X86-NEXT: movl $5, -4(%ebp)
; X86-NEXT: addl $4, %esp
; X86-NEXT: popl %ebp
; X86-NEXT: retl
call void @callee_clobber_rbp()
%addr = alloca i32, align 4
store i32 5, ptr %addr, align 4
ret void
}
define void @caller_use_rbx(i32 %X) nounwind ssp {
; X64-LABEL: caller_use_rbx:
; X64: # %bb.0:
; X64-NEXT: pushq %rbp
; X64-NEXT: movq %rsp, %rbp
; X64-NEXT: pushq %rbx
; X64-NEXT: andq $-32, %rsp
; X64-NEXT: subq $64, %rsp
; X64-NEXT: movq %rsp, %rbx
; X64-NEXT: movq __stack_chk_guard(%rip), %rax
; X64-NEXT: movq %rax, 32(%rbx)
; X64-NEXT: movq %rsp, %rax
; X64-NEXT: movl %edi, %ecx
; X64-NEXT: leaq 15(,%rcx,4), %rcx
; X64-NEXT: andq $-16, %rcx
; X64-NEXT: subq %rcx, %rax
; X64-NEXT: movq %rax, %rsp
; X64-NEXT: movq %rbx, %rdi
; X64-NEXT: callq callee_clobber_rbx
; X64-NEXT: movq __stack_chk_guard(%rip), %rax
; X64-NEXT: cmpq 32(%rbx), %rax
; X64-NEXT: jne .LBB4_2
; X64-NEXT: # %bb.1:
; X64-NEXT: leaq -8(%rbp), %rsp
; X64-NEXT: popq %rbx
; X64-NEXT: popq %rbp
; X64-NEXT: retq
; X64-NEXT: .LBB4_2:
; X64-NEXT: callq __stack_chk_fail@PLT
%realign = alloca i32, align 32
%addr = alloca i32, i32 %X
call void @callee_clobber_rbx(ptr %realign)
ret void
}
define void @caller_use_esi(i32 %X) nounwind ssp {
; X86-LABEL: caller_use_esi:
; X86: # %bb.0:
; X86-NEXT: pushl %ebp
; X86-NEXT: movl %esp, %ebp
; X86-NEXT: pushl %esi
; X86-NEXT: andl $-32, %esp
; X86-NEXT: subl $32, %esp
; X86-NEXT: movl %esp, %esi
; X86-NEXT: movl 8(%ebp), %eax
; X86-NEXT: movl __stack_chk_guard, %ecx
; X86-NEXT: movl %ecx, 16(%esi)
; X86-NEXT: movl %esp, %ecx
; X86-NEXT: shll $2, %eax
; X86-NEXT: subl %eax, %ecx
; X86-NEXT: movl %ecx, %esp
; X86-NEXT: movl %esi, %eax
; X86-NEXT: pushl %eax
; X86-NEXT: calll callee_clobber_esi
; X86-NEXT: addl $4, %esp
; X86-NEXT: movl __stack_chk_guard, %eax
; X86-NEXT: cmpl 16(%esi), %eax
; X86-NEXT: jne .LBB5_2
; X86-NEXT: # %bb.1:
; X86-NEXT: leal -4(%ebp), %esp
; X86-NEXT: popl %esi
; X86-NEXT: popl %ebp
; X86-NEXT: retl
; X86-NEXT: .LBB5_2:
; X86-NEXT: calll __stack_chk_fail
%realign = alloca i32, align 32
%addr = alloca i32, i32 %X
call void @callee_clobber_esi(ptr %realign)
ret void
}