Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/BPF/bpf-fastcall-regmask-1.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

111 lines
4.1 KiB
LLVM

; RUN: llc -O2 --mtriple=bpfel \
; RUN: -print-after=stack-slot-coloring %s \
; RUN: -o /dev/null 2>&1 | FileCheck %s
; Generated from the following C code:
;
; #define __bpf_fastcall __attribute__((bpf_fastcall))
;
; void bar1(void) __bpf_fastcall;
; void buz1(long i, long j, long k);
; void foo1(long i, long j, long k) {
; bar1();
; buz1(i, j, k);
; }
;
; long bar2(void) __bpf_fastcall;
; void buz2(long i, long j, long k);
; void foo2(long i, long j, long k) {
; bar2();
; buz2(i, j, k);
; }
;
; void bar3(long) __bpf_fastcall;
; void buz3(long i, long j, long k);
; void foo3(long i, long j, long k) {
; bar3(i);
; buz3(i, j, k);
; }
;
; long bar4(long, long) __bpf_fastcall;
; void buz4(long i, long j, long k);
; void foo4(long i, long j, long k) {
; bar4(i, j);
; buz4(i, j, k);
; }
;
; Using the following command:
;
; clang --target=bpf -emit-llvm -O2 -S -o - t.c
;
; (unnecessary attrs removed maually)
; Check regmask for calls to functions marked with bpf_fastcall:
; - void function w/o parameters
; - non-void function w/o parameters
; - void function with parameters
; - non-void function with parameters
declare dso_local void @bar1() #0
declare dso_local void @buz1(i64 noundef, i64 noundef, i64 noundef)
define dso_local void @foo1(i64 noundef %i, i64 noundef %j, i64 noundef %k) {
entry:
tail call void @bar1() #1
tail call void @buz1(i64 noundef %i, i64 noundef %j, i64 noundef %k)
ret void
}
; CHECK: JAL @bar1, <regmask $r0 $r1 $r2 $r3 $r4 $r5 $r6 $r7 $r8 $r9 $r10
; CHECK-SAME: $w0 $w1 $w2 $w3 $w4 $w5 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit-def $r11
; CHECK: JAL @buz1, <regmask $r6 $r7 $r8 $r9 $r10 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit $r1, implicit $r2, implicit $r3, implicit-def $r11
declare dso_local i64 @bar2() #0
declare dso_local void @buz2(i64 noundef, i64 noundef, i64 noundef)
define dso_local void @foo2(i64 noundef %i, i64 noundef %j, i64 noundef %k) {
entry:
tail call i64 @bar2() #1
tail call void @buz2(i64 noundef %i, i64 noundef %j, i64 noundef %k)
ret void
}
; CHECK: JAL @bar2, <regmask $r1 $r2 $r3 $r4 $r5 $r6 $r7 $r8 $r9 $r10
; CHECK-SAME: $w1 $w2 $w3 $w4 $w5 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit-def $r11, implicit-def dead $r0
; CHECK: JAL @buz2, <regmask $r6 $r7 $r8 $r9 $r10 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit $r1, implicit $r2, implicit $r3, implicit-def $r11
declare dso_local void @bar3(i64) #0
declare dso_local void @buz3(i64 noundef, i64 noundef, i64 noundef)
define dso_local void @foo3(i64 noundef %i, i64 noundef %j, i64 noundef %k) {
entry:
tail call void @bar3(i64 noundef %i) #1
tail call void @buz3(i64 noundef %i, i64 noundef %j, i64 noundef %k)
ret void
}
; CHECK: JAL @bar3, <regmask $r0 $r2 $r3 $r4 $r5 $r6 $r7 $r8 $r9 $r10
; CHECK-SAME: $w0 $w2 $w3 $w4 $w5 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit $r1, implicit-def $r11
; CHECK: JAL @buz3, <regmask $r6 $r7 $r8 $r9 $r10 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit $r1, implicit $r2, implicit $r3, implicit-def $r11
declare dso_local i64 @bar4(i64 noundef, i64 noundef) #0
declare dso_local void @buz4(i64 noundef, i64 noundef, i64 noundef)
define dso_local void @foo4(i64 noundef %i, i64 noundef %j, i64 noundef %k) {
entry:
tail call i64 @bar4(i64 noundef %i, i64 noundef %j) #1
tail call void @buz4(i64 noundef %i, i64 noundef %j, i64 noundef %k)
ret void
}
; CHECK: JAL @bar4, <regmask $r3 $r4 $r5 $r6 $r7 $r8 $r9 $r10
; CHECK-SAME: $w3 $w4 $w5 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit $r1, implicit $r2, implicit-def $r11, implicit-def dead $r0
; CHECK: JAL @buz4, <regmask $r6 $r7 $r8 $r9 $r10 $w6 $w7 $w8 $w9 $w10>
; CHECK-SAME: , implicit $r11, implicit $r1, implicit $r2, implicit $r3, implicit-def $r11
attributes #0 = { "bpf_fastcall" }
attributes #1 = { nounwind "bpf_fastcall" }