llvm-project/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cubeid.ll
vangthao95 20e59c8e2d
AMDGPU/GlobalISel: RegBankLegalize rules for cube intrinsics (#187762)
Add RegBankLegalize rules for cube* intrinsics. Also update manual tests
to use autogenerated checks.
2026-03-24 08:05:36 -07:00

31 lines
1.3 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=tahiti < %s | FileCheck -check-prefix=GCN %s
; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=tahiti < %s | FileCheck -check-prefix=GCN %s
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=fiji < %s | FileCheck -check-prefix=GCN %s
; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=fiji < %s | FileCheck -check-prefix=GCN %s
declare float @llvm.amdgcn.cubeid(float, float, float) #0
define amdgpu_ps float @test_cubeid_vvv(float %a, float %b, float %c) #1 {
; GCN-LABEL: test_cubeid_vvv:
; GCN: ; %bb.0:
; GCN-NEXT: v_cubeid_f32 v0, v0, v1, v2
; GCN-NEXT: ; return to shader part epilog
%result = call float @llvm.amdgcn.cubeid(float %a, float %b, float %c)
ret float %result
}
define amdgpu_ps float @test_cubeid_sss(float inreg %a, float inreg %b, float inreg %c) #1 {
; GCN-LABEL: test_cubeid_sss:
; GCN: ; %bb.0:
; GCN-NEXT: v_mov_b32_e32 v0, s1
; GCN-NEXT: v_mov_b32_e32 v1, s2
; GCN-NEXT: v_cubeid_f32 v0, s0, v0, v1
; GCN-NEXT: ; return to shader part epilog
%result = call float @llvm.amdgcn.cubeid(float %a, float %b, float %c)
ret float %result
}
attributes #0 = { nounwind readnone }
attributes #1 = { nounwind }