Files
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

53 lines
1.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=infer-address-spaces -o - %s | FileCheck %s
; https://github.com/llvm/llvm-project/issues/53665
define i32 @addrspacecast_ptrtoint_inttoptr(ptr addrspace(1) %arg) {
; CHECK-LABEL: @addrspacecast_ptrtoint_inttoptr(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(1) [[ARG:%.*]], align 4
; CHECK-NEXT: ret i32 [[LOAD]]
;
bb:
%asc = addrspacecast ptr addrspace(1) %arg to ptr
%p2i = ptrtoint ptr %asc to i64
%i2p = inttoptr i64 %p2i to ptr
%load = load i32, ptr %i2p
ret i32 %load
}
define i32 @assumed_ptrtoint_inttoptr(ptr %arg) {
bb:
%is.priv = call i1 @llvm.amdgcn.is.private(ptr %arg)
%not.is.priv = xor i1 %is.priv, -1
%is.shared = call i1 @llvm.amdgcn.is.shared(ptr %arg)
%not.is.shared = xor i1 %is.shared, -1
%and = and i1 %not.is.priv, %not.is.shared
tail call void @llvm.assume(i1 %and)
%p2i = ptrtoint ptr %arg to i64
%i2p = inttoptr i64 %p2i to ptr
%load = load i32, ptr %i2p
ret i32 %load
}
define i32 @addrspacecast_ptrtoint_inttptr_nontrivial(ptr addrspace(3) %arg) {
; CHECK-LABEL: @addrspacecast_ptrtoint_inttptr_nontrivial(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(3) [[ARG:%.*]], align 4
; CHECK-NEXT: ret i32 [[LOAD]]
;
bb:
%asc = addrspacecast ptr addrspace(3) %arg to ptr
%p2i = ptrtoint ptr %asc to i64
%i2p = inttoptr i64 %p2i to ptr
%load = load i32, ptr %i2p
ret i32 %load
}
declare void @llvm.assume(i1 noundef) #0
declare i1 @llvm.amdgcn.is.shared(ptr nocapture) #1
declare i1 @llvm.amdgcn.is.private(ptr nocapture) #1
attributes #0 = { inaccessiblememonly nofree nosync nounwind willreturn }
attributes #1 = { nounwind readnone speculatable willreturn }