https://github.com/krzysz00 updated https://github.com/llvm/llvm-project/pull/231299
>From 403d89dae07a97a08a9135efd21842e97a911275 Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak <[email protected]> Date: Fri, 9 Oct 2026 02:28:16 +0000 Subject: [PATCH] [AMDGPU][NFC] Pre-commit test for integer raw.ptr.buffer.load.format llvm.amdgcn.raw.ptr.buffer.load.format is restricted to floats for some reason, even though it doesn't need to be (per its non-`.ptr` counterpart). Pre-commit tests for the integer form. AI disclosure: Claude wrote these tests, I wrote the message, the big comment is temporary. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --- ...dgcn.raw.ptr.buffer.load.format.integer.ll | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.ptr.buffer.load.format.integer.ll diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.ptr.buffer.load.format.integer.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.ptr.buffer.load.format.integer.ll new file mode 100644 index 0000000000000..56556377fa0eb --- /dev/null +++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.ptr.buffer.load.format.integer.ll @@ -0,0 +1,26 @@ +; RUN: not llc -mtriple=amdgcn -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck %s +; RUN: not llc -global-isel -mtriple=amdgcn -mcpu=gfx900 -filetype=null %s 2>&1 | FileCheck %s + +; Only the first offending declaration is reported, so do not pin the type. +; CHECK: error: intrinsic return type (overload type 0) expected any fp or fp vector + +define amdgpu_ps <4 x float> @raw_ptr_buffer_load_format_v4i32(ptr addrspace(8) inreg %rsrc) { +main_body: + %data = call <4 x i32> @llvm.amdgcn.raw.ptr.buffer.load.format.v4i32(ptr addrspace(8) %rsrc, i32 0, i32 0, i32 0) + %fdata = bitcast <4 x i32> %data to <4 x float> + ret <4 x float> %fdata +} + +define amdgpu_ps <4 x float> @raw_ptr_buffer_load_format_ofs_v4i32(ptr addrspace(8) inreg %rsrc, i32 %voffset) { +main_body: + %data = call <4 x i32> @llvm.amdgcn.raw.ptr.buffer.load.format.v4i32(ptr addrspace(8) %rsrc, i32 %voffset, i32 0, i32 0) + %fdata = bitcast <4 x i32> %data to <4 x float> + ret <4 x float> %fdata +} + +define amdgpu_ps float @raw_ptr_buffer_load_format_i32(ptr addrspace(8) inreg %rsrc, i32 %voffset, i32 inreg %soffset) { +main_body: + %data = call i32 @llvm.amdgcn.raw.ptr.buffer.load.format.i32(ptr addrspace(8) %rsrc, i32 %voffset, i32 %soffset, i32 0) + %fdata = bitcast i32 %data to float + ret float %fdata +} _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
