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
43 lines
1.5 KiB
LLVM
43 lines
1.5 KiB
LLVM
; RUN: llc -O3 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 < %s | FileCheck %s
|
|
|
|
; Reduced from rocrand's threefry2x32_20 kernel.
|
|
; The AMDGPU LSR cost model should avoid creating a redundant VGPR induction
|
|
; variable when the loop already has a vector IV incremented by a uniform
|
|
; (SGPR) stride. Without the cost model fix, LSR introduces a second v_add
|
|
; in the loop body, wasting a VGPR and a VALU slot every iteration.
|
|
|
|
declare i32 @llvm.amdgcn.workitem.id.x() #0
|
|
|
|
; CHECK-LABEL: {{^}}lsr_vector_iv_cost:
|
|
; The loop must contain exactly one VALU add — the single vector IV update.
|
|
; A second v_add_u32 here would mean LSR created a redundant IV.
|
|
; CHECK: {{^}}.LBB0_1:
|
|
; CHECK: v_add_u32
|
|
; CHECK-NOT: v_add_u32
|
|
; CHECK: s_cbranch
|
|
define amdgpu_kernel void @lsr_vector_iv_cost(<2 x i32> %arg0, i32 %stride, ptr addrspace(1) %out) {
|
|
entry:
|
|
%tid = tail call i32 @llvm.amdgcn.workitem.id.x()
|
|
br label %loop
|
|
|
|
loop:
|
|
%iv.pn = phi i32 [ 0, %entry ], [ %or, %loop ]
|
|
%iv.vec = phi i32 [ %tid, %entry ], [ %sum1, %loop ]
|
|
%sum1 = add i32 %iv.vec, %stride
|
|
%elt = extractelement <2 x i32> %arg0, i64 0
|
|
%sum2 = add i32 %sum1, %elt
|
|
%xor = xor i32 1, %sum2
|
|
%sum3 = add i32 %sum2, %xor
|
|
%sum4 = add i32 %sum3, %elt
|
|
%or = or i32 %sum4, %stride
|
|
%shr = lshr i32 %iv.pn, 1
|
|
%cmp = icmp ult i32 %sum1, 1024
|
|
br i1 %cmp, label %loop, label %exit
|
|
|
|
exit:
|
|
store i32 %or, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
|