Files
TheRock/compiler/amd-llvm/llvm/test/Analysis/CostModel/AArch64/pow-special.ll
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

120 lines
11 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 6
; RUN: opt -mtriple=aarch64-- -mattr=+sve -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output < %s | FileCheck %s --check-prefix=CHECK-NO-ARMPL
; RUN: opt -mtriple=aarch64-- -mattr=+sve -passes="print<cost-model>" -vector-library=ArmPL -cost-kind=all 2>&1 -disable-output < %s | FileCheck %s --check-prefix=CHECK-ARMPL
; Test special exponents of pow that we know will be optimised in the backend
; to something that isn't a pow call.
; NOTE: We don't test exponents of 0.5 because these should be canonicalised
; during instsimplify to a sqrt call.
; Scalar variants
define void @pow_f32_f64(float %a, double %b) {
; CHECK-NO-ARMPL-LABEL: 'pow_f32_f64'
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_f32 = call fast float @llvm.pow.f32(float %a, float 2.500000e-01)
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_f32 = call fast float @llvm.pow.f32(float %a, float f0x3EAAAAAB)
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_f32 = call fast float @llvm.pow.f32(float %a, float 7.500000e-01)
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_f64 = call fast double @llvm.pow.f64(double %b, double 2.500000e-01)
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_f64 = call fast double @llvm.pow.f64(double %b, double f0x3FD5555555555555)
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_f64 = call fast double @llvm.pow.f64(double %b, double 7.500000e-01)
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
; CHECK-ARMPL-LABEL: 'pow_f32_f64'
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_f32 = call fast float @llvm.pow.f32(float %a, float 2.500000e-01)
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_f32 = call fast float @llvm.pow.f32(float %a, float f0x3EAAAAAB)
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_f32 = call fast float @llvm.pow.f32(float %a, float 7.500000e-01)
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_f64 = call fast double @llvm.pow.f64(double %b, double 2.500000e-01)
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_f64 = call fast double @llvm.pow.f64(double %b, double f0x3FD5555555555555)
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_f64 = call fast double @llvm.pow.f64(double %b, double 7.500000e-01)
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%pow_0p25_f32 = call fast float @llvm.pow.f32(float %a, float 2.5e-01)
%pow_one_third_f32 = call fast float @llvm.pow.f32(float %a, float 0x3FD5555560000000)
%pow_0p75_f32 = call fast float @llvm.pow.f32(float %a, float 7.5e-01)
%pow_0p25_f64 = call fast double @llvm.pow.f64(double %b, double 2.5e-01)
%pow_one_third_f64 = call fast double @llvm.pow.f64(double %b, double 0x3FD5555555555555)
%pow_0p75_f64 = call fast double @llvm.pow.f64(double %b, double 7.5e-01)
ret void
}
; Vector variants
define void @pow_v4f32(<4 x float> %a) {
; CHECK-NO-ARMPL-LABEL: 'pow_v4f32'
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float 2.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:52 CodeSize:46 Lat:52 SizeLat:52 for: %pow_one_third_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float f0x3EAAAAAB))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float 7.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
; CHECK-ARMPL-LABEL: 'pow_v4f32'
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float 2.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float f0x3EAAAAAB))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float 7.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%pow_0p25_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float 2.5e-01))
%pow_one_third_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float 0x3FD5555560000000))
%pow_0p75_v4f32 = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %a, <4 x float> splat (float 7.5e-01))
ret void
}
define void @pow_v2f64(<2 x double> %a) {
; CHECK-NO-ARMPL-LABEL: 'pow_v2f64'
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double 2.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:24 CodeSize:22 Lat:24 SizeLat:24 for: %pow_one_third_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double f0x3FD5555555555555))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double 7.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
; CHECK-ARMPL-LABEL: 'pow_v2f64'
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double 2.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double f0x3FD5555555555555))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double 7.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%pow_0p25_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double 2.5e-01))
%pow_one_third_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double 0x3FD5555555555555))
%pow_0p75_v2f64 = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %a, <2 x double> splat (double 7.5e-01))
ret void
}
define void @pow_nxv4f32(<vscale x 4 x float> %a) {
; CHECK-NO-ARMPL-LABEL: 'pow_nxv4f32'
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of Invalid for: %pow_0p25_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float 2.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of Invalid for: %pow_one_third_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float f0x3EAAAAAB))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of Invalid for: %pow_0p75_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float 7.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
; CHECK-ARMPL-LABEL: 'pow_nxv4f32'
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float 2.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float f0x3EAAAAAB))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float 7.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%pow_0p25_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float 2.5e-01))
%pow_one_third_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float 0x3FD5555560000000))
%pow_0p75_nxv4f32 = call fast <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> splat (float 7.5e-01))
ret void
}
define void @pow_nxv2f64(<vscale x 2 x double> %a) {
; CHECK-NO-ARMPL-LABEL: 'pow_nxv2f64'
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of Invalid for: %pow_0p25_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double 2.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of Invalid for: %pow_one_third_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double f0x3FD5555555555555))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of Invalid for: %pow_0p75_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double 7.500000e-01))
; CHECK-NO-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
; CHECK-ARMPL-LABEL: 'pow_nxv2f64'
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 2 for: %pow_0p25_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double 2.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of 10 for: %pow_one_third_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double f0x3FD5555555555555))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:5 SizeLat:3 for: %pow_0p75_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double 7.500000e-01))
; CHECK-ARMPL-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%pow_0p25_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double 2.5e-01))
%pow_one_third_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double 0x3FD5555555555555))
%pow_0p75_nxv2f64 = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> splat (double 7.5e-01))
ret void
}