|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py |
| 2 | +; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=aarch64 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-BASE |
| 3 | +; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=aarch64 -mattr=+sve2 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-SVE |
| 4 | + |
| 5 | +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
| 6 | +target triple = "aarch64-linux-gnu" |
| 7 | + |
| 8 | +define void @ldexp() { |
| 9 | +; CHECK-LABEL: 'ldexp' |
| 10 | +; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = call float @llvm.ldexp.f32.i32(float poison, i32 poison) |
| 11 | +; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %2 = call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison) |
| 12 | +; CHECK-NEXT: Cost Model: Found costs of RThru:10 CodeSize:7 Lat:10 SizeLat:10 for: %3 = call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> poison, <4 x i32> poison) |
| 13 | +; CHECK-NEXT: Cost Model: Found costs of RThru:20 CodeSize:14 Lat:20 SizeLat:20 for: %4 = call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> poison, <8 x i32> poison) |
| 14 | +; CHECK-NEXT: Cost Model: Found costs of RThru:40 CodeSize:28 Lat:40 SizeLat:40 for: %5 = call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> poison, <16 x i32> poison) |
| 15 | +; CHECK-NEXT: Cost Model: Found costs of 1 for: %6 = call double @llvm.ldexp.f64.i32(double poison, i32 poison) |
| 16 | +; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %7 = call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> poison, <2 x i32> poison) |
| 17 | +; CHECK-NEXT: Cost Model: Found costs of RThru:8 CodeSize:6 Lat:8 SizeLat:8 for: %8 = call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> poison, <4 x i32> poison) |
| 18 | +; CHECK-NEXT: Cost Model: Found costs of RThru:16 CodeSize:12 Lat:16 SizeLat:16 for: %9 = call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> poison, <8 x i32> poison) |
| 19 | +; CHECK-NEXT: Cost Model: Found costs of RThru:32 CodeSize:24 Lat:32 SizeLat:32 for: %10 = call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> poison, <16 x i32> poison) |
| 20 | +; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void |
| 21 | +; |
| 22 | + call float @llvm.ldexp.f32.i32(float poison, i32 poison) |
| 23 | + call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> poison, <2 x i32> poison) |
| 24 | + call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> poison, <4 x i32> poison) |
| 25 | + call <8 x float> @llvm.ldexp.v8f32.v8i32(<8 x float> poison, <8 x i32> poison) |
| 26 | + call <16 x float> @llvm.ldexp.v16f32.v16i32(<16 x float> poison, <16 x i32> poison) |
| 27 | + call double @llvm.ldexp.f64.i32(double poison, i32 poison) |
| 28 | + call <2 x double> @llvm.ldexp.v2f64.v2i32(<2 x double> poison, <2 x i32> poison) |
| 29 | + call <4 x double> @llvm.ldexp.v4f64.v4i32(<4 x double> poison, <4 x i32> poison) |
| 30 | + call <8 x double> @llvm.ldexp.v8f64.v8i32(<8 x double> poison, <8 x i32> poison) |
| 31 | + call <16 x double> @llvm.ldexp.v16f64.v16i32(<16 x double> poison, <16 x i32> poison) |
| 32 | + ret void |
| 33 | +} |
| 34 | + |
| 35 | +define void @ldexp_fp16() { |
| 36 | +; CHECK-LABEL: 'ldexp_fp16' |
| 37 | +; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = call half @llvm.ldexp.f16.i32(half poison, i32 poison) |
| 38 | +; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %2 = call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> poison, <2 x i32> poison) |
| 39 | +; CHECK-NEXT: Cost Model: Found costs of RThru:10 CodeSize:7 Lat:10 SizeLat:10 for: %3 = call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> poison, <4 x i32> poison) |
| 40 | +; CHECK-NEXT: Cost Model: Found costs of RThru:22 CodeSize:15 Lat:22 SizeLat:22 for: %4 = call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> poison, <8 x i32> poison) |
| 41 | +; CHECK-NEXT: Cost Model: Found costs of RThru:44 CodeSize:30 Lat:44 SizeLat:44 for: %5 = call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> poison, <16 x i32> poison) |
| 42 | +; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void |
| 43 | +; |
| 44 | + call half @llvm.ldexp.f16.i32(half poison, i32 poison) |
| 45 | + call <2 x half> @llvm.ldexp.v2f16.v2i32(<2 x half> poison, <2 x i32> poison) |
| 46 | + call <4 x half> @llvm.ldexp.v4f16.v4i32(<4 x half> poison, <4 x i32> poison) |
| 47 | + call <8 x half> @llvm.ldexp.v8f16.v8i32(<8 x half> poison, <8 x i32> poison) |
| 48 | + call <16 x half> @llvm.ldexp.v16f16.v16i32(<16 x half> poison, <16 x i32> poison) |
| 49 | + ret void |
| 50 | +} |
| 51 | + |
| 52 | +define void @ldexp_bf16() { |
| 53 | +; CHECK-LABEL: 'ldexp_bf16' |
| 54 | +; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison) |
| 55 | +; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:3 Lat:4 SizeLat:4 for: %2 = call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison) |
| 56 | +; CHECK-NEXT: Cost Model: Found costs of RThru:10 CodeSize:7 Lat:10 SizeLat:10 for: %3 = call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> poison, <4 x i32> poison) |
| 57 | +; CHECK-NEXT: Cost Model: Found costs of RThru:22 CodeSize:15 Lat:22 SizeLat:22 for: %4 = call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> poison, <8 x i32> poison) |
| 58 | +; CHECK-NEXT: Cost Model: Found costs of RThru:44 CodeSize:30 Lat:44 SizeLat:44 for: %5 = call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> poison, <16 x i32> poison) |
| 59 | +; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void |
| 60 | +; |
| 61 | + call bfloat @llvm.ldexp.bf16.i32(bfloat poison, i32 poison) |
| 62 | + call <2 x bfloat> @llvm.ldexp.v2bf16.v2i32(<2 x bfloat> poison, <2 x i32> poison) |
| 63 | + call <4 x bfloat> @llvm.ldexp.v4bf16.v4i32(<4 x bfloat> poison, <4 x i32> poison) |
| 64 | + call <8 x bfloat> @llvm.ldexp.v8bf16.v8i32(<8 x bfloat> poison, <8 x i32> poison) |
| 65 | + call <16 x bfloat> @llvm.ldexp.v16bf16.v16i32(<16 x bfloat> poison, <16 x i32> poison) |
| 66 | + ret void |
| 67 | +} |
| 68 | +;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: |
| 69 | +; CHECK-BASE: {{.*}} |
| 70 | +; CHECK-SVE: {{.*}} |
0 commit comments