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
143 lines
3.8 KiB
LLVM
143 lines
3.8 KiB
LLVM
; Test that accesses of the stack remain within the range defined by R1,
|
|
; i.e. that loads and stores only access the allocated stack. This does not
|
|
; have to be the case when red zone is present.
|
|
|
|
; Make sure that there is no red zone, i.e. ppc32 and SVR4 ABI.
|
|
; RUN: llc -mtriple=powerpc--freebsd-elf < %s | FileCheck %s
|
|
|
|
; There are two ways that the stack pointer can be adjusted in the prologue:
|
|
; - by adding an immediate value:
|
|
; stwu r1, -imm(r1)
|
|
; - by adding another register:
|
|
; stwux r1, rx, r1
|
|
;
|
|
; The restoring of the stack pointer can be done:
|
|
; - by adding an immediate value to it:
|
|
; addi r1, r1, imm
|
|
; - by copying the value from another register:
|
|
; mr r1, rx
|
|
|
|
|
|
; Nothing (no special features).
|
|
;
|
|
; CHECK-LABEL: test_n:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwu 1, -[[SIZE:[0-9]+]](1)
|
|
; CHECK: addi 1, 1, [[SIZE]]
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
define i32 @test_n() local_unnamed_addr #0 {
|
|
entry:
|
|
%t0 = tail call i32 @bar0() #0
|
|
ret i32 %t0
|
|
}
|
|
|
|
; Aligned object on the stack.
|
|
;
|
|
; CHECK-LABEL: test_a:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwux 1, 1, {{[0-9]+}}
|
|
; CHECK: mr 1, {{[0-9]+}}
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
|
|
define i32 @test_a() local_unnamed_addr #0 {
|
|
entry:
|
|
%t0 = alloca i32, align 128
|
|
%t1 = tail call i32 @bar1(ptr %t0) #0
|
|
ret i32 %t1
|
|
}
|
|
|
|
; Dynamic allocation on the stack.
|
|
;
|
|
; CHECK-LABEL: test_d:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwu 1, -[[SIZE:[0-9]+]](1)
|
|
; CHECK: mr 1, {{[0-9]+}}
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
define i32 @test_d(i32 %p0) local_unnamed_addr #0 {
|
|
%t0 = alloca i32, i32 %p0, align 4
|
|
%t1 = tail call i32 @bar1(ptr %t0) #0
|
|
ret i32 %t1
|
|
}
|
|
|
|
; Large stack (exceeds size of D-field).
|
|
; CHECK-LABEL: test_s:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwux 1, 1, {{[0-9]+}}
|
|
; CHECK: mr 1, {{[0-9]+}}
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
define i32 @test_s(i32 %p0) local_unnamed_addr #0 {
|
|
entry:
|
|
%t0 = alloca [16384 x i32]
|
|
%t2 = tail call i32 @bar1(ptr %t0) #0
|
|
ret i32 %t2
|
|
}
|
|
|
|
; Combinations.
|
|
|
|
; CHECK-LABEL: test_ad:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwux 1, 1, {{[0-9]+}}
|
|
; CHECK: mr 1, {{[0-9]+}}
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
define i32 @test_ad(i32 %p0) local_unnamed_addr #0 {
|
|
%t0 = alloca i32, align 128
|
|
%t1 = alloca i32, i32 %p0, align 4
|
|
%t2 = tail call i32 @bar1(ptr %t0) #0
|
|
%t3 = tail call i32 @bar1(ptr %t1) #0
|
|
%t4 = add i32 %t2, %t3
|
|
ret i32 %t4
|
|
}
|
|
|
|
; CHECK-LABEL: test_as:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwux 1, 1, {{[0-9]+}}
|
|
; CHECK: mr 1, {{[0-9]+}}
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
define i32 @test_as() local_unnamed_addr #0 {
|
|
%t0 = alloca i32, align 128
|
|
%t1 = alloca [16384 x i32]
|
|
%t2 = tail call i32 @bar1(ptr %t0) #0
|
|
%t4 = tail call i32 @bar1(ptr %t1) #0
|
|
%t5 = add i32 %t2, %t4
|
|
ret i32 %t5
|
|
}
|
|
|
|
; CHECK-LABEL: test_ds:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwux 1, 1, {{[0-9]+}}
|
|
; CHECK: mr 1, {{[0-9]+}}
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
define i32 @test_ds(i32 %p0) local_unnamed_addr #0 {
|
|
%t0 = alloca i32, i32 %p0, align 4
|
|
%t1 = alloca [16384 x i32]
|
|
%t2 = tail call i32 @bar1(ptr %t0) #0
|
|
%t4 = tail call i32 @bar1(ptr %t1) #0
|
|
%t5 = add i32 %t2, %t4
|
|
ret i32 %t5
|
|
}
|
|
|
|
; CHECK-LABEL: test_ads:
|
|
; CHECK-NOT: stw {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
; CHECK: stwux 1, 1, {{[0-9]+}}
|
|
; CHECK: mr 1, {{[0-9]+}}
|
|
; CHECK-NOT: lwz {{[0-9]+}}, -{{[0-9]+}}(1)
|
|
define i32 @test_ads(i32 %p0) local_unnamed_addr #0 {
|
|
%t0 = alloca i32, align 128
|
|
%t1 = alloca i32, i32 %p0, align 4
|
|
%t2 = alloca [16384 x i32]
|
|
|
|
%t3 = tail call i32 @bar1(ptr %t0) #0
|
|
%t4 = tail call i32 @bar1(ptr %t1) #0
|
|
%t5 = add i32 %t3, %t4
|
|
|
|
%t7 = tail call i32 @bar1(ptr %t2) #0
|
|
%t8 = add i32 %t5, %t7
|
|
ret i32 %t7
|
|
}
|
|
|
|
|
|
declare i32 @bar0(...) local_unnamed_addr #0
|
|
declare i32 @bar1(...) local_unnamed_addr #0
|
|
|
|
attributes #0 = { nounwind }
|