Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/InferAddressSpaces/NVPTX/phinode-address-infer.ll
T
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

58 lines
2.3 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -mtriple=nvptx64-nvidia-cuda -passes='require<domtree>,infer-address-spaces' %s | FileCheck %s
;;; Handle write corner case for infer-address-spaces with phi-nodes. The
;;; verifier will crash if we insert `addrspacecast` before phi-node.
declare void @llvm.assume(i1 noundef)
declare i1 @llvm.nvvm.isspacep.shared(ptr)
declare i1 @llvm.nvvm.isspacep.global(ptr)
define void @phinode_instr() {
; CHECK-LABEL: @phinode_instr(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[PTR_1:%.*]] = load ptr, ptr null, align 8
; CHECK-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[PTR_1]] to ptr addrspace(3)
; CHECK-NEXT: [[BOOL_1:%.*]] = tail call i1 @llvm.nvvm.isspacep.shared(ptr [[PTR_1]])
; CHECK-NEXT: tail call void @llvm.assume(i1 [[BOOL_1]])
; CHECK-NEXT: br label [[IF_SINK_SPLIT:%.*]]
; CHECK: if.sink.split:
; CHECK-NEXT: [[PTR_SINK:%.*]] = phi ptr addrspace(3) [ [[TMP0]], [[ENTRY:%.*]] ]
; CHECK-NEXT: store i32 1, ptr addrspace(3) [[PTR_SINK]], align 4
; CHECK-NEXT: ret void
;
entry:
%ptr.1 = load ptr, ptr null, align 8
%bool.1 = tail call i1 @llvm.nvvm.isspacep.shared(ptr %ptr.1)
tail call void @llvm.assume(i1 %bool.1)
br label %if.sink.split
if.sink.split: ; preds = %entry
%ptr.sink = phi ptr [ %ptr.1, %entry ]
store i32 1, ptr %ptr.sink, align 4
ret void
}
define void @phinode_argument(ptr %lhs_ptr) {
; CHECK-LABEL: @phinode_argument(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[LHS_PTR:%.*]] to ptr addrspace(1)
; CHECK-NEXT: [[BOOL_1:%.*]] = tail call i1 @llvm.nvvm.isspacep.global(ptr [[LHS_PTR]])
; CHECK-NEXT: tail call void @llvm.assume(i1 [[BOOL_1]])
; CHECK-NEXT: br label [[IF_SINK_SPLIT:%.*]]
; CHECK: if.sink.split:
; CHECK-NEXT: [[PTR_SINK:%.*]] = phi ptr addrspace(1) [ [[TMP0]], [[ENTRY:%.*]] ]
; CHECK-NEXT: store i32 1, ptr addrspace(1) [[PTR_SINK]], align 4
; CHECK-NEXT: ret void
;
entry:
%bool.1 = tail call i1 @llvm.nvvm.isspacep.global(ptr %lhs_ptr)
tail call void @llvm.assume(i1 %bool.1)
br label %if.sink.split
if.sink.split: ; preds = %entry
%ptr.sink = phi ptr [ %lhs_ptr, %entry ]
store i32 1, ptr %ptr.sink, align 4
ret void
}