Files
TheRock/compiler/amd-llvm/bolt/test/AArch64/epilogue-determination.s
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

94 lines
1.6 KiB
ArmAsm

# Test that we will not incorrectly take the first basic block in function
# `_foo` or the second basic block in function `_goo` as epilogue, and will
# recognize epilogues in the other cases.
# RUN: %clang %cflags %s -o %t.so -Wl,-q,-z,undefs
# RUN: llvm-bolt %t.so -o %t.bolt --print-cfg | FileCheck %s
.text
.global _foo
.type _foo, %function
_foo:
ldr w8, [sp]
adr x10, _jmptbl
ldrsw x9, [x10, x9, lsl #2]
add x10, x10, x9
br x10
# CHECK-LABEL: _foo
# CHECK: br x10
# CHECK-SAME: # UNKNOWN CONTROL FLOW
mov x0, 0
ret
mov x0, 1
ret
.balign 4
_jmptbl:
.long -16
.long -8
.global _bar
.type _bar, %function
_bar:
stp x29, x30, [sp, #-0x10]!
mov x29, sp
sub sp, sp, #0x10
tbnz x0, #0x3, _L2
ldr x8, [x29, #0x30]
blr x8
_L2:
add sp, sp, #0x10
ldp x29, x30, [sp], #0x10
br x2
# CHECK-LABEL: _bar
# CHECK: br x2
# CHECK-SAME: # TAILCALL
.global _goo
.type _goo, %function
_goo:
ldr w8, [sp]
adr x10, _jmptbl2
ldrsw x9, [x10, x9, lsl #2]
add x10, x10, x9
str x30, [sp, #-0x10]!
bl _bar
ldr x30, [sp], #0x10
mov x1, x0
mov x0, xzr
br x10
# CHECK-LABEL: _goo
# CHECK: br x10
# CHECK-SAME: # UNKNOWN CONTROL FLOW
mov x0, 0
ret
mov x0, 1
ret
.balign 4
_jmptbl2:
.long -16
.long -8
.global _faz
.type _faz, %function
_faz:
str x30, [sp, #-0x10]!
tbnz x0, #0x1, _L3
bl _bar
_L3:
ldr x30, [sp], #0x10
mov x0, x1
br x3
# CHECK-LABEL: _faz
# CHECK: br x3
# CHECK-SAME: # TAILCALL
.global _start
.type _start, %function
_start:
ret
# Dummy relocation to force relocation mode
.reloc 0, R_AARCH64_NONE