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
120 lines
4.6 KiB
LLVM
120 lines
4.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
|
|
; RUN: opt -S -passes='instcombine' -mtriple=amdgcn-amd-amdhsa < %s | FileCheck %s --check-prefix=AMDHSA
|
|
; RUN: opt -S -passes='instcombine' -mtriple=amdgcn-mesa-mesa3d < %s | FileCheck %s --check-prefix=MESA
|
|
|
|
; InstCombine added retattr dereferenceable(bytes) to a "call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()".
|
|
|
|
define ptr addrspace(4) @foo() {
|
|
; AMDHSA-LABEL: define ptr addrspace(4) @foo() {
|
|
; AMDHSA-NEXT: [[ENTRY:.*:]]
|
|
; AMDHSA-NEXT: [[TMP:%.*]] = tail call dereferenceable(256) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; AMDHSA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
; MESA-LABEL: define ptr addrspace(4) @foo() {
|
|
; MESA-NEXT: [[ENTRY:.*:]]
|
|
; MESA-NEXT: [[TMP:%.*]] = tail call dereferenceable(16) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; MESA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
entry:
|
|
%tmp = tail call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
ret ptr addrspace(4) %tmp
|
|
}
|
|
|
|
define ptr addrspace(4) @bar() {
|
|
; AMDHSA-LABEL: define ptr addrspace(4) @bar() {
|
|
; AMDHSA-NEXT: [[ENTRY:.*:]]
|
|
; AMDHSA-NEXT: [[TMP:%.*]] = tail call dereferenceable(256) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; AMDHSA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
; MESA-LABEL: define ptr addrspace(4) @bar() {
|
|
; MESA-NEXT: [[ENTRY:.*:]]
|
|
; MESA-NEXT: [[TMP:%.*]] = tail call dereferenceable(128) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; MESA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
entry:
|
|
%tmp = tail call dereferenceable(128) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
ret ptr addrspace(4) %tmp
|
|
}
|
|
|
|
define ptr addrspace(4) @baz() {
|
|
; AMDHSA-LABEL: define ptr addrspace(4) @baz() {
|
|
; AMDHSA-NEXT: [[ENTRY:.*:]]
|
|
; AMDHSA-NEXT: [[TMP:%.*]] = tail call dereferenceable(512) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; AMDHSA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
; MESA-LABEL: define ptr addrspace(4) @baz() {
|
|
; MESA-NEXT: [[ENTRY:.*:]]
|
|
; MESA-NEXT: [[TMP:%.*]] = tail call dereferenceable(512) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; MESA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
entry:
|
|
%tmp = tail call dereferenceable(512) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
ret ptr addrspace(4) %tmp
|
|
}
|
|
|
|
define ptr addrspace(4) @derefornull() {
|
|
; AMDHSA-LABEL: define ptr addrspace(4) @derefornull() {
|
|
; AMDHSA-NEXT: [[ENTRY:.*:]]
|
|
; AMDHSA-NEXT: [[TMP:%.*]] = tail call dereferenceable(256) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; AMDHSA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
; MESA-LABEL: define ptr addrspace(4) @derefornull() {
|
|
; MESA-NEXT: [[ENTRY:.*:]]
|
|
; MESA-NEXT: [[TMP:%.*]] = tail call dereferenceable(64) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
; MESA-NEXT: ret ptr addrspace(4) [[TMP]]
|
|
;
|
|
entry:
|
|
%tmp = tail call dereferenceable_or_null(64) ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
ret ptr addrspace(4) %tmp
|
|
}
|
|
|
|
; When amdgpu-no-implicitarg-ptr is set, calling the intrinsic is UB and the
|
|
; call should be folded to poison.
|
|
define ptr addrspace(4) @no_implicitarg_ptr() #2 {
|
|
; AMDHSA-LABEL: define ptr addrspace(4) @no_implicitarg_ptr(
|
|
; AMDHSA-SAME: ) #[[ATTR0:[0-9]+]] {
|
|
; AMDHSA-NEXT: [[ENTRY:.*:]]
|
|
; AMDHSA-NEXT: ret ptr addrspace(4) poison
|
|
;
|
|
; MESA-LABEL: define ptr addrspace(4) @no_implicitarg_ptr(
|
|
; MESA-SAME: ) #[[ATTR0:[0-9]+]] {
|
|
; MESA-NEXT: [[ENTRY:.*:]]
|
|
; MESA-NEXT: ret ptr addrspace(4) poison
|
|
;
|
|
entry:
|
|
%tmp = tail call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
ret ptr addrspace(4) %tmp
|
|
}
|
|
|
|
; When amdgpu-no-implicitarg-ptr is set, a load from the intrinsic's returned
|
|
; pointer is also UB. The call folds to poison and loading from poison yields
|
|
; poison via existing InstCombine rules.
|
|
define i32 @no_implicitarg_ptr_load() #2 {
|
|
; AMDHSA-LABEL: define i32 @no_implicitarg_ptr_load(
|
|
; AMDHSA-SAME: ) #[[ATTR0]] {
|
|
; AMDHSA-NEXT: [[ENTRY:.*:]]
|
|
; AMDHSA-NEXT: store i1 true, ptr poison, align 1
|
|
; AMDHSA-NEXT: ret i32 poison
|
|
;
|
|
; MESA-LABEL: define i32 @no_implicitarg_ptr_load(
|
|
; MESA-SAME: ) #[[ATTR0]] {
|
|
; MESA-NEXT: [[ENTRY:.*:]]
|
|
; MESA-NEXT: store i1 true, ptr poison, align 1
|
|
; MESA-NEXT: ret i32 poison
|
|
;
|
|
entry:
|
|
%ptr = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
|
|
%val = load i32, ptr addrspace(4) %ptr
|
|
ret i32 %val
|
|
}
|
|
|
|
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
|
|
declare noundef align 4 ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr() #1
|
|
|
|
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
|
|
attributes #2 = { "amdgpu-no-implicitarg-ptr" }
|
|
|
|
!llvm.module.flags = !{!0}
|
|
|
|
!0 = !{i32 1, !"amdhsa_code_object_version", i32 600}
|