Files
TheRock/compiler/amd-llvm/llvm/test/Analysis/CostModel/AArch64/sve-cmpsel.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

187 lines
11 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=aarch64--linux-gnu -mattr=+sve < %s | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
; Check icmp for legal integer vectors.
define void @cmp_legal_int() {
; CHECK-LABEL: 'cmp_legal_int'
; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = icmp ne <vscale x 2 x i64> undef, undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = icmp ne <vscale x 4 x i32> undef, undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = icmp ne <vscale x 8 x i16> undef, undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = icmp ne <vscale x 16 x i8> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%1 = icmp ne <vscale x 2 x i64> undef, undef
%2 = icmp ne <vscale x 4 x i32> undef, undef
%3 = icmp ne <vscale x 8 x i16> undef, undef
%4 = icmp ne <vscale x 16 x i8> undef, undef
ret void
}
; Check icmp for an illegal integer vector.
define <vscale x 4 x i1> @cmp_nxv4i64() {
; CHECK-LABEL: 'cmp_nxv4i64'
; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = icmp ne <vscale x 4 x i64> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 4 x i1> %res
;
%res = icmp ne <vscale x 4 x i64> undef, undef
ret <vscale x 4 x i1> %res
}
; Check icmp for legal predicate vectors.
define void @cmp_legal_pred() {
; CHECK-LABEL: 'cmp_legal_pred'
; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = icmp ne <vscale x 2 x i1> undef, undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = icmp ne <vscale x 4 x i1> undef, undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = icmp ne <vscale x 8 x i1> undef, undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = icmp ne <vscale x 16 x i1> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%1 = icmp ne <vscale x 2 x i1> undef, undef
%2 = icmp ne <vscale x 4 x i1> undef, undef
%3 = icmp ne <vscale x 8 x i1> undef, undef
%4 = icmp ne <vscale x 16 x i1> undef, undef
ret void
}
; Check icmp for an illegal predicate vector.
define <vscale x 32 x i1> @cmp_nxv32i1() {
; CHECK-LABEL: 'cmp_nxv32i1'
; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = icmp ne <vscale x 32 x i1> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 32 x i1> %res
;
%res = icmp ne <vscale x 32 x i1> undef, undef
ret <vscale x 32 x i1> %res
}
; Check fcmp for legal FP vectors
define void @cmp_legal_fp() #0 {
; CHECK-LABEL: 'cmp_legal_fp'
; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %1 = fcmp oge <vscale x 2 x double> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %2 = fcmp oge <vscale x 4 x float> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:2 SizeLat:1 for: %3 = fcmp oge <vscale x 8 x half> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:13 CodeSize:11 Lat:11 SizeLat:11 for: %4 = fcmp oge <vscale x 8 x bfloat> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%1 = fcmp oge <vscale x 2 x double> undef, undef
%2 = fcmp oge <vscale x 4 x float> undef, undef
%3 = fcmp oge <vscale x 8 x half> undef, undef
%4 = fcmp oge <vscale x 8 x bfloat> undef, undef
ret void
}
; Check fcmp for an illegal FP vector
define <vscale x 16 x i1> @cmp_nxv16f16() {
; CHECK-LABEL: 'cmp_nxv16f16'
; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:2 Lat:2 SizeLat:2 for: %res = fcmp oge <vscale x 16 x half> undef, undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 16 x i1> %res
;
%res = fcmp oge <vscale x 16 x half> undef, undef
ret <vscale x 16 x i1> %res
}
; Check select for legal integer vectors
define void @sel_legal_int() {
; CHECK-LABEL: 'sel_legal_int'
; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = select <vscale x 2 x i1> undef, <vscale x 2 x i64> undef, <vscale x 2 x i64> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = select <vscale x 4 x i1> undef, <vscale x 4 x i32> undef, <vscale x 4 x i32> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = select <vscale x 8 x i1> undef, <vscale x 8 x i16> undef, <vscale x 8 x i16> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = select <vscale x 16 x i1> undef, <vscale x 16 x i8> undef, <vscale x 16 x i8> undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%1 = select <vscale x 2 x i1> undef, <vscale x 2 x i64> undef, <vscale x 2 x i64> undef
%2 = select <vscale x 4 x i1> undef, <vscale x 4 x i32> undef, <vscale x 4 x i32> undef
%3 = select <vscale x 8 x i1> undef, <vscale x 8 x i16> undef, <vscale x 8 x i16> undef
%4 = select <vscale x 16 x i1> undef, <vscale x 16 x i8> undef, <vscale x 16 x i8> undef
ret void
}
; Check select for an illegal integer vector
define <vscale x 16 x i16> @sel_nxv16i16() {
; CHECK-LABEL: 'sel_nxv16i16'
; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = select <vscale x 16 x i1> undef, <vscale x 16 x i16> undef, <vscale x 16 x i16> undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 16 x i16> %res
;
%res = select <vscale x 16 x i1> undef, <vscale x 16 x i16> undef, <vscale x 16 x i16> undef
ret <vscale x 16 x i16> %res
}
; Check select for a legal FP vector
define void @sel_legal_fp() #0 {
; CHECK-LABEL: 'sel_legal_fp'
; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = select <vscale x 2 x i1> undef, <vscale x 2 x double> undef, <vscale x 2 x double> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = select <vscale x 4 x i1> undef, <vscale x 4 x float> undef, <vscale x 4 x float> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = select <vscale x 8 x i1> undef, <vscale x 8 x half> undef, <vscale x 8 x half> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = select <vscale x 8 x i1> undef, <vscale x 8 x bfloat> undef, <vscale x 8 x bfloat> undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%1 = select <vscale x 2 x i1> undef, <vscale x 2 x double> undef, <vscale x 2 x double> undef
%2 = select <vscale x 4 x i1> undef, <vscale x 4 x float> undef, <vscale x 4 x float> undef
%3 = select <vscale x 8 x i1> undef, <vscale x 8 x half> undef, <vscale x 8 x half> undef
%4 = select <vscale x 8 x i1> undef, <vscale x 8 x bfloat> undef, <vscale x 8 x bfloat> undef
ret void
}
; Check select for an illegal FP vector
define <vscale x 8 x float> @sel_nxv8f32() {
; CHECK-LABEL: 'sel_nxv8f32'
; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = select <vscale x 8 x i1> undef, <vscale x 8 x float> undef, <vscale x 8 x float> undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 8 x float> %res
;
%res = select <vscale x 8 x i1> undef, <vscale x 8 x float> undef, <vscale x 8 x float> undef
ret <vscale x 8 x float> %res
}
; Check select for a legal predicate vector
define void @sel_legal_pred() {
; CHECK-LABEL: 'sel_legal_pred'
; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = select <vscale x 2 x i1> undef, <vscale x 2 x i1> undef, <vscale x 2 x i1> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %2 = select <vscale x 4 x i1> undef, <vscale x 4 x i1> undef, <vscale x 4 x i1> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %3 = select <vscale x 8 x i1> undef, <vscale x 8 x i1> undef, <vscale x 8 x i1> undef
; CHECK-NEXT: Cost Model: Found costs of 1 for: %4 = select <vscale x 16 x i1> undef, <vscale x 16 x i1> undef, <vscale x 16 x i1> undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%1 = select <vscale x 2 x i1> undef, <vscale x 2 x i1> undef, <vscale x 2 x i1> undef
%2 = select <vscale x 4 x i1> undef, <vscale x 4 x i1> undef, <vscale x 4 x i1> undef
%3 = select <vscale x 8 x i1> undef, <vscale x 8 x i1> undef, <vscale x 8 x i1> undef
%4 = select <vscale x 16 x i1> undef, <vscale x 16 x i1> undef, <vscale x 16 x i1> undef
ret void
}
; Check select for an illegal predicate vector
define <vscale x 32 x i1> @sel_nxv32i1() {
; CHECK-LABEL: 'sel_nxv32i1'
; CHECK-NEXT: Cost Model: Found costs of 2 for: %res = select <vscale x 32 x i1> undef, <vscale x 32 x i1> undef, <vscale x 32 x i1> undef
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <vscale x 32 x i1> %res
;
%res = select <vscale x 32 x i1> undef, <vscale x 32 x i1> undef, <vscale x 32 x i1> undef
ret <vscale x 32 x i1> %res
}
define void @uscmp() {
; CHECK-LABEL: 'uscmp'
; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv16i8 = call <vscale x 16 x i8> @llvm.ucmp.nxv16i8.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i8> undef)
; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv8i16 = call <vscale x 8 x i16> @llvm.ucmp.nxv8i16.nxv8i16(<vscale x 8 x i16> undef, <vscale x 8 x i16> undef)
; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv4i32 = call <vscale x 4 x i32> @llvm.ucmp.nxv4i32.nxv4i32(<vscale x 4 x i32> undef, <vscale x 4 x i32> undef)
; CHECK-NEXT: Cost Model: Found costs of 4 for: %uv2i64 = call <vscale x 2 x i64> @llvm.ucmp.nxv2i64.nxv2i64(<vscale x 2 x i64> undef, <vscale x 2 x i64> undef)
; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv16i8 = call <vscale x 16 x i8> @llvm.scmp.nxv16i8.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i8> undef)
; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv8i16 = call <vscale x 8 x i16> @llvm.scmp.nxv8i16.nxv8i16(<vscale x 8 x i16> undef, <vscale x 8 x i16> undef)
; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv4i32 = call <vscale x 4 x i32> @llvm.scmp.nxv4i32.nxv4i32(<vscale x 4 x i32> undef, <vscale x 4 x i32> undef)
; CHECK-NEXT: Cost Model: Found costs of 4 for: %sv2i64 = call <vscale x 2 x i64> @llvm.scmp.nxv2i64.nxv2i64(<vscale x 2 x i64> undef, <vscale x 2 x i64> undef)
; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
;
%uv16i8 = call <vscale x 16 x i8> @llvm.ucmp(<vscale x 16 x i8> undef, <vscale x 16 x i8> undef)
%uv8i16 = call <vscale x 8 x i16> @llvm.ucmp(<vscale x 8 x i16> undef, <vscale x 8 x i16> undef)
%uv4i32 = call <vscale x 4 x i32> @llvm.ucmp(<vscale x 4 x i32> undef, <vscale x 4 x i32> undef)
%uv2i64 = call <vscale x 2 x i64> @llvm.ucmp(<vscale x 2 x i64> undef, <vscale x 2 x i64> undef)
%sv16i8 = call <vscale x 16 x i8> @llvm.scmp(<vscale x 16 x i8> undef, <vscale x 16 x i8> undef)
%sv8i16 = call <vscale x 8 x i16> @llvm.scmp(<vscale x 8 x i16> undef, <vscale x 8 x i16> undef)
%sv4i32 = call <vscale x 4 x i32> @llvm.scmp(<vscale x 4 x i32> undef, <vscale x 4 x i32> undef)
%sv2i64 = call <vscale x 2 x i64> @llvm.scmp(<vscale x 2 x i64> undef, <vscale x 2 x i64> undef)
ret void
}
attributes #0 = { "target-features"="+sve,+bf16" }