[llvm] [AMDGPU] Add half vector support for table-driven libcall optimzation (PR #178638)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 30 06:57:16 PST 2026
================
@@ -1,82 +1,64 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib %s | FileCheck %s
-define amdgpu_kernel void @test_tdo_scalar_f32_acos(ptr addrspace(1) %out) {
-; CHECK-LABEL: define amdgpu_kernel void @test_tdo_scalar_f32_acos(
-; CHECK-SAME: ptr addrspace(1) [[OUT:%.*]]) {
+define float @test_tdo_scalar_f32_acos() {
+; CHECK-LABEL: define float @test_tdo_scalar_f32_acos() {
; CHECK-NEXT: [[ENTRY:.*:]]
-; CHECK-NEXT: store float 0x3FF921FB60000000, ptr addrspace(1) [[OUT]], align 4
-; CHECK-NEXT: ret void
+; CHECK-NEXT: ret float 0x3FF921FB60000000
;
entry:
%c = call float @_Z4acosf(float 0.000000e+00)
- store float %c, ptr addrspace(1) %out, align 4
- ret void
+ ret float %c
}
-define amdgpu_kernel void @test_tdo_v2_f32_acos(ptr addrspace(1) %out) {
-; CHECK-LABEL: define amdgpu_kernel void @test_tdo_v2_f32_acos(
-; CHECK-SAME: ptr addrspace(1) [[OUT:%.*]]) {
+define <2 x float> @test_tdo_v2_f32_acos() {
+; CHECK-LABEL: define <2 x float> @test_tdo_v2_f32_acos() {
; CHECK-NEXT: [[ENTRY:.*:]]
-; CHECK-NEXT: store <2 x float> <float 0x3FF921FB60000000, float 0.000000e+00>, ptr addrspace(1) [[OUT]], align 8
-; CHECK-NEXT: ret void
+; CHECK-NEXT: ret <2 x float> <float 0x3FF921FB60000000, float 0.000000e+00>
;
entry:
%c = call <2 x float> @_Z4acosDv2_f(<2 x float> <float 0.000000e+00, float 1.000000e+00>)
----------------
arsenm wrote:
Ideally would test vector with all the special values in the table
https://github.com/llvm/llvm-project/pull/178638
More information about the llvm-commits
mailing list