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
108 lines
5.2 KiB
LLVM
108 lines
5.2 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
|
|
; RUN: opt -S -mtriple=amdgcn-- -passes=amdgpu-simplifylib < %s | FileCheck %s
|
|
|
|
; sin and cos are already defined in the module but sincos isn't.
|
|
|
|
define float @_Z3sinf(float noundef %x) {
|
|
; CHECK-LABEL: define float @_Z3sinf
|
|
; CHECK-SAME: (float noundef [[X:%.*]]) {
|
|
; CHECK-NEXT: [[RESULT:%.*]] = call float asm "
|
|
; CHECK-NEXT: ret float [[RESULT]]
|
|
;
|
|
%result = call float asm "; $0 = sin($1)","=v,v"(float %x)
|
|
ret float %result
|
|
}
|
|
|
|
define float @_Z3cosf(float noundef %x) {
|
|
; CHECK-LABEL: define float @_Z3cosf
|
|
; CHECK-SAME: (float noundef [[X:%.*]]) {
|
|
; CHECK-NEXT: [[RESULT:%.*]] = call float asm "
|
|
; CHECK-NEXT: ret float [[RESULT]]
|
|
;
|
|
%result = call float asm "; $0 = cos($1)","=v,v"(float %x)
|
|
ret float %result
|
|
}
|
|
|
|
define <2 x float> @_Z3sinDv2_f(<2 x float> noundef %x) {
|
|
; CHECK-LABEL: define <2 x float> @_Z3sinDv2_f
|
|
; CHECK-SAME: (<2 x float> noundef [[X:%.*]]) {
|
|
; CHECK-NEXT: [[RESULT:%.*]] = call <2 x float> asm "
|
|
; CHECK-NEXT: ret <2 x float> [[RESULT]]
|
|
;
|
|
%result = call <2 x float> asm "; $0 = sin($1)","=v,v"(<2 x float> %x)
|
|
ret <2 x float> %result
|
|
}
|
|
|
|
define <2 x float> @_Z3cosDv2_f(<2 x float> noundef %x) {
|
|
; CHECK-LABEL: define <2 x float> @_Z3cosDv2_f
|
|
; CHECK-SAME: (<2 x float> noundef [[X:%.*]]) {
|
|
; CHECK-NEXT: [[RESULT:%.*]] = call <2 x float> asm "
|
|
; CHECK-NEXT: ret <2 x float> [[RESULT]]
|
|
;
|
|
%result = call <2 x float> asm "; $0 = cos($1)","=v,v"(<2 x float> %x)
|
|
ret <2 x float> %result
|
|
}
|
|
|
|
define void @sincos_f32(float noundef %x, ptr addrspace(1) nocapture noundef writeonly %sin_out, ptr addrspace(1) nocapture noundef writeonly %cos_out) {
|
|
; CHECK-LABEL: define void @sincos_f32
|
|
; CHECK-SAME: (float noundef [[X:%.*]], ptr addrspace(1) noundef writeonly captures(none) [[SIN_OUT:%.*]], ptr addrspace(1) noundef writeonly captures(none) [[COS_OUT:%.*]]) {
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[CALL:%.*]] = tail call contract float @_Z3sinf(float noundef [[X]])
|
|
; CHECK-NEXT: store float [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
|
|
; CHECK-NEXT: [[CALL1:%.*]] = tail call contract float @_Z3cosf(float noundef [[X]])
|
|
; CHECK-NEXT: store float [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%call = tail call contract float @_Z3sinf(float noundef %x)
|
|
store float %call, ptr addrspace(1) %sin_out, align 4
|
|
%call1 = tail call contract float @_Z3cosf(float noundef %x)
|
|
store float %call1, ptr addrspace(1) %cos_out, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @sincos_f32_value_is_same_constantfp(ptr addrspace(1) nocapture noundef writeonly %sin_out, ptr addrspace(1) nocapture noundef writeonly %cos_out) {
|
|
; CHECK-LABEL: define void @sincos_f32_value_is_same_constantfp
|
|
; CHECK-SAME: (ptr addrspace(1) noundef writeonly captures(none) [[SIN_OUT:%.*]], ptr addrspace(1) noundef writeonly captures(none) [[COS_OUT:%.*]]) {
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[CALL:%.*]] = tail call contract float @_Z3sinf(float 4.200000e+01)
|
|
; CHECK-NEXT: store float [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 4
|
|
; CHECK-NEXT: [[CALL1:%.*]] = tail call contract float @_Z3cosf(float 4.200000e+01)
|
|
; CHECK-NEXT: store float [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 4
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%call = tail call contract float @_Z3sinf(float 42.0)
|
|
store float %call, ptr addrspace(1) %sin_out, align 4
|
|
%call1 = tail call contract float @_Z3cosf(float 42.0)
|
|
store float %call1, ptr addrspace(1) %cos_out, align 4
|
|
ret void
|
|
}
|
|
|
|
define void @sincos_v2f32(<2 x float> noundef %x, ptr addrspace(1) nocapture noundef writeonly %sin_out, ptr addrspace(1) nocapture noundef writeonly %cos_out) {
|
|
; GCN-LABEL: define void @sincos_v2f32
|
|
; GCN-SAME: (<2 x float> noundef [[X:%.*]], ptr addrspace(1) nocapture noundef writeonly [[SIN_OUT:%.*]], ptr addrspace(1) nocapture noundef writeonly [[COS_OUT:%.*]]) local_unnamed_addr {
|
|
; GCN-NEXT: entry:
|
|
; GCN-NEXT: [[CALL:%.*]] = tail call contract <2 x float> @_Z3sinDv2_f(<2 x float> noundef [[X]])
|
|
; GCN-NEXT: store <2 x float> [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 8
|
|
; GCN-NEXT: [[CALL1:%.*]] = tail call contract <2 x float> @_Z3cosDv2_f(<2 x float> noundef [[X]])
|
|
; GCN-NEXT: store <2 x float> [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 8
|
|
; GCN-NEXT: ret void
|
|
;
|
|
; CHECK-LABEL: define void @sincos_v2f32
|
|
; CHECK-SAME: (<2 x float> noundef [[X:%.*]], ptr addrspace(1) noundef writeonly captures(none) [[SIN_OUT:%.*]], ptr addrspace(1) noundef writeonly captures(none) [[COS_OUT:%.*]]) {
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[CALL:%.*]] = tail call contract <2 x float> @_Z3sinDv2_f(<2 x float> noundef [[X]])
|
|
; CHECK-NEXT: store <2 x float> [[CALL]], ptr addrspace(1) [[SIN_OUT]], align 8
|
|
; CHECK-NEXT: [[CALL1:%.*]] = tail call contract <2 x float> @_Z3cosDv2_f(<2 x float> noundef [[X]])
|
|
; CHECK-NEXT: store <2 x float> [[CALL1]], ptr addrspace(1) [[COS_OUT]], align 8
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%call = tail call contract <2 x float> @_Z3sinDv2_f(<2 x float> noundef %x)
|
|
store <2 x float> %call, ptr addrspace(1) %sin_out, align 8
|
|
%call1 = tail call contract <2 x float> @_Z3cosDv2_f(<2 x float> noundef %x)
|
|
store <2 x float> %call1, ptr addrspace(1) %cos_out, align 8
|
|
ret void
|
|
}
|