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
61 lines
2.2 KiB
LLVM
61 lines
2.2 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -disable-simplify-libcalls -passes=instcombine -S | FileCheck %s
|
|
|
|
declare double @llvm.pow.f64(double, double)
|
|
declare double @pow(double, double)
|
|
|
|
define double @sqrt_libcall(double %x) {
|
|
; CHECK-LABEL: @sqrt_libcall(
|
|
; CHECK-NEXT: [[RETVAL:%.*]] = call double @pow(double [[X:%.*]], double 5.000000e-01)
|
|
; CHECK-NEXT: ret double [[RETVAL]]
|
|
;
|
|
%retval = call double @pow(double %x, double 0.5)
|
|
ret double %retval
|
|
}
|
|
|
|
define double @sqrt_intrinsic(double %x) {
|
|
; CHECK-LABEL: @sqrt_intrinsic(
|
|
; CHECK-NEXT: [[SQRT:%.*]] = call double @llvm.sqrt.f64(double [[X:%.*]])
|
|
; CHECK-NEXT: [[ABS:%.*]] = call double @llvm.fabs.f64(double [[SQRT]])
|
|
; CHECK-NEXT: [[ISINF:%.*]] = fcmp oeq double [[X]], -inf
|
|
; CHECK-NEXT: [[RETVAL:%.*]] = select i1 [[ISINF]], double +inf, double [[ABS]]
|
|
; CHECK-NEXT: ret double [[RETVAL]]
|
|
;
|
|
%retval = call double @llvm.pow.f64(double %x, double 0.5)
|
|
ret double %retval
|
|
}
|
|
|
|
; Shrinking is disabled too.
|
|
|
|
define float @shrink_libcall(float %f, float %g) {
|
|
; CHECK-LABEL: @shrink_libcall(
|
|
; CHECK-NEXT: [[DF:%.*]] = fpext float [[F:%.*]] to double
|
|
; CHECK-NEXT: [[DG:%.*]] = fpext float [[G:%.*]] to double
|
|
; CHECK-NEXT: [[CALL:%.*]] = call fast double @pow(double [[DF]], double [[DG]])
|
|
; CHECK-NEXT: [[FR:%.*]] = fptrunc double [[CALL]] to float
|
|
; CHECK-NEXT: ret float [[FR]]
|
|
;
|
|
%df = fpext float %f to double
|
|
%dg = fpext float %g to double
|
|
%call = call fast double @pow(double %df, double %dg)
|
|
%fr = fptrunc double %call to float
|
|
ret float %fr
|
|
}
|
|
|
|
; Shrinking is disabled for the intrinsic too.
|
|
|
|
define float @shrink_intrinsic(float %f, float %g) {
|
|
; CHECK-LABEL: @shrink_intrinsic(
|
|
; CHECK-NEXT: [[DF:%.*]] = fpext float [[F:%.*]] to double
|
|
; CHECK-NEXT: [[DG:%.*]] = fpext float [[G:%.*]] to double
|
|
; CHECK-NEXT: [[CALL:%.*]] = call fast double @llvm.pow.f64(double [[DF]], double [[DG]])
|
|
; CHECK-NEXT: [[FR:%.*]] = fptrunc double [[CALL]] to float
|
|
; CHECK-NEXT: ret float [[FR]]
|
|
;
|
|
%df = fpext float %f to double
|
|
%dg = fpext float %g to double
|
|
%call = call fast double @llvm.pow.f64(double %df, double %dg)
|
|
%fr = fptrunc double %call to float
|
|
ret float %fr
|
|
}
|