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
48 lines
1.7 KiB
LLVM
48 lines
1.7 KiB
LLVM
; RUN: opt -mtriple=amdgcn-- -O1 -S < %s | FileCheck %s --check-prefixes=FUNC,LOOP
|
|
; RUN: opt -mtriple=amdgcn-- -passes='default<O1>' -S < %s | FileCheck %s --check-prefixes=FUNC,LOOP
|
|
; RUN: opt -mtriple=amdgcn-- -O1 -S -disable-promote-alloca-to-vector < %s | FileCheck %s --check-prefixes=FUNC,FULL-UNROLL
|
|
; RUN: opt -mtriple=amdgcn-- -passes='default<O1>' -S -disable-promote-alloca-to-vector < %s | FileCheck %s --check-prefixes=FUNC,FULL-UNROLL
|
|
|
|
; This test contains a simple loop that initializes an array declared in
|
|
; private memory. This loop would be fully unrolled if we could not SROA
|
|
; the alloca. Check that we successfully eliminate it before the unroll,
|
|
; so that we do not need to fully unroll it.
|
|
|
|
; FUNC-LABEL: @private_memory
|
|
; LOOP-NOT: = alloca
|
|
; LOOP: loop.header:
|
|
; LOOP: br i1 %{{[^,]+}}, label %exit, label %loop.header
|
|
|
|
; FULL-UNROLL: alloca
|
|
; FULL-UNROLL-COUNT-256: store i32 {{[0-9]+}}, ptr addrspace(5)
|
|
; FULL-UNROLL-NOT: br
|
|
|
|
; FUNC: store i32 %{{[^,]+}}, ptr addrspace(1) %out
|
|
define amdgpu_kernel void @private_memory(ptr addrspace(1) %out, i32 %n) {
|
|
entry:
|
|
%alloca = alloca [16 x i32], addrspace(5)
|
|
br label %loop.header
|
|
|
|
loop.header:
|
|
%counter = phi i32 [0, %entry], [%inc, %loop.inc]
|
|
br label %loop.body
|
|
|
|
loop.body:
|
|
%salt = xor i32 %counter, %n
|
|
%idx = and i32 %salt, 15
|
|
%ptr = getelementptr [16 x i32], ptr addrspace(5) %alloca, i32 0, i32 %idx
|
|
store i32 %counter, ptr addrspace(5) %ptr
|
|
br label %loop.inc
|
|
|
|
loop.inc:
|
|
%inc = add i32 %counter, 1
|
|
%cmp = icmp sge i32 %counter, 255
|
|
br i1 %cmp, label %exit, label %loop.header
|
|
|
|
exit:
|
|
%gep = getelementptr [16 x i32], ptr addrspace(5) %alloca, i32 0, i32 %n
|
|
%load = load i32, ptr addrspace(5) %gep
|
|
store i32 %load, ptr addrspace(1) %out
|
|
ret void
|
|
}
|