[llvm] [CostModel][X86] Add baseline costs for smulh/umulh intrinsics (PR #224022)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 06:54:28 PDT 2026
https://github.com/RKSimon created https://github.com/llvm/llvm-project/pull/224022
None
>From 12969d198da2c89b08bd02b23c3cfb0388ab6161 Mon Sep 17 00:00:00 2001
From: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: Wed, 16 Sep 2026 14:53:30 +0100
Subject: [PATCH] [CostModel][X86] Add baseline costs for smulh/umulh
intrinsics
---
.../test/Analysis/CostModel/X86/arith-mulh.ll | 289 ++++++++++++++++++
1 file changed, 289 insertions(+)
create mode 100644 llvm/test/Analysis/CostModel/X86/arith-mulh.ll
diff --git a/llvm/test/Analysis/CostModel/X86/arith-mulh.ll b/llvm/test/Analysis/CostModel/X86/arith-mulh.ll
new file mode 100644
index 0000000000000..644c4237e05e5
--- /dev/null
+++ b/llvm/test/Analysis/CostModel/X86/arith-mulh.ll
@@ -0,0 +1,289 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- | FileCheck %s --check-prefixes=SSE2
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mattr=+ssse3 | FileCheck %s --check-prefixes=SSSE3
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mattr=+sse4.2 | FileCheck %s --check-prefixes=SSE42
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mattr=+avx | FileCheck %s --check-prefixes=AVX1
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mattr=+avx2 | FileCheck %s --check-prefixes=AVX2
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mattr=+avx512f | FileCheck %s --check-prefixes=AVX512
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=AVX512
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=AVX512
+;
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mcpu=slm | FileCheck %s --check-prefixes=SSE42
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mcpu=goldmont | FileCheck %s --check-prefixes=SSE42
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-- -mcpu=btver2 | FileCheck %s --check-prefixes=AVX1
+
+define i32 @smulh(i32 %arg) {
+; SSE2-LABEL: 'smulh'
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.smulh.i64(i64 undef, i64 undef)
+; SSE2-NEXT: Cost Model: Found costs of 5 for: %V2I64 = call <2 x i64> @llvm.smulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; SSE2-NEXT: Cost Model: Found costs of 10 for: %V4I64 = call <4 x i64> @llvm.smulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; SSE2-NEXT: Cost Model: Found costs of 20 for: %V8I64 = call <8 x i64> @llvm.smulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.smulh.i32(i32 undef, i32 undef)
+; SSE2-NEXT: Cost Model: Found costs of 11 for: %V4I32 = call <4 x i32> @llvm.smulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; SSE2-NEXT: Cost Model: Found costs of 22 for: %V8I32 = call <8 x i32> @llvm.smulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; SSE2-NEXT: Cost Model: Found costs of 44 for: %V16I32 = call <16 x i32> @llvm.smulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.smulh.i16(i16 undef, i16 undef)
+; SSE2-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.smulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; SSE2-NEXT: Cost Model: Found costs of 32 for: %V16I16 = call <16 x i16> @llvm.smulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; SSE2-NEXT: Cost Model: Found costs of 64 for: %V32I16 = call <32 x i16> @llvm.smulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.smulh.i8(i8 undef, i8 undef)
+; SSE2-NEXT: Cost Model: Found costs of 47 for: %V16I8 = call <16 x i8> @llvm.smulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; SSE2-NEXT: Cost Model: Found costs of 94 for: %V32I8 = call <32 x i8> @llvm.smulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; SSE2-NEXT: Cost Model: Found costs of 188 for: %V64I8 = call <64 x i8> @llvm.smulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; SSE2-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; SSSE3-LABEL: 'smulh'
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.smulh.i64(i64 undef, i64 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 5 for: %V2I64 = call <2 x i64> @llvm.smulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 10 for: %V4I64 = call <4 x i64> @llvm.smulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 20 for: %V8I64 = call <8 x i64> @llvm.smulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.smulh.i32(i32 undef, i32 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 11 for: %V4I32 = call <4 x i32> @llvm.smulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 22 for: %V8I32 = call <8 x i32> @llvm.smulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 44 for: %V16I32 = call <16 x i32> @llvm.smulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.smulh.i16(i16 undef, i16 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.smulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 32 for: %V16I16 = call <16 x i16> @llvm.smulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 64 for: %V32I16 = call <32 x i16> @llvm.smulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.smulh.i8(i8 undef, i8 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 47 for: %V16I8 = call <16 x i8> @llvm.smulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 94 for: %V32I8 = call <32 x i8> @llvm.smulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 188 for: %V64I8 = call <64 x i8> @llvm.smulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; SSSE3-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; SSE42-LABEL: 'smulh'
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.smulh.i64(i64 undef, i64 undef)
+; SSE42-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.smulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; SSE42-NEXT: Cost Model: Found costs of 8 for: %V4I64 = call <4 x i64> @llvm.smulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; SSE42-NEXT: Cost Model: Found costs of 16 for: %V8I64 = call <8 x i64> @llvm.smulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.smulh.i32(i32 undef, i32 undef)
+; SSE42-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.smulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; SSE42-NEXT: Cost Model: Found costs of 16 for: %V8I32 = call <8 x i32> @llvm.smulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; SSE42-NEXT: Cost Model: Found costs of 32 for: %V16I32 = call <16 x i32> @llvm.smulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.smulh.i16(i16 undef, i16 undef)
+; SSE42-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.smulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; SSE42-NEXT: Cost Model: Found costs of 32 for: %V16I16 = call <16 x i16> @llvm.smulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; SSE42-NEXT: Cost Model: Found costs of 64 for: %V32I16 = call <32 x i16> @llvm.smulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.smulh.i8(i8 undef, i8 undef)
+; SSE42-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.smulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; SSE42-NEXT: Cost Model: Found costs of 64 for: %V32I8 = call <32 x i8> @llvm.smulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; SSE42-NEXT: Cost Model: Found costs of 128 for: %V64I8 = call <64 x i8> @llvm.smulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; SSE42-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; AVX1-LABEL: 'smulh'
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.smulh.i64(i64 undef, i64 undef)
+; AVX1-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.smulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; AVX1-NEXT: Cost Model: Found costs of 9 for: %V4I64 = call <4 x i64> @llvm.smulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; AVX1-NEXT: Cost Model: Found costs of 18 for: %V8I64 = call <8 x i64> @llvm.smulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.smulh.i32(i32 undef, i32 undef)
+; AVX1-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.smulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; AVX1-NEXT: Cost Model: Found costs of 17 for: %V8I32 = call <8 x i32> @llvm.smulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; AVX1-NEXT: Cost Model: Found costs of 34 for: %V16I32 = call <16 x i32> @llvm.smulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.smulh.i16(i16 undef, i16 undef)
+; AVX1-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.smulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; AVX1-NEXT: Cost Model: Found costs of 33 for: %V16I16 = call <16 x i16> @llvm.smulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; AVX1-NEXT: Cost Model: Found costs of 66 for: %V32I16 = call <32 x i16> @llvm.smulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.smulh.i8(i8 undef, i8 undef)
+; AVX1-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.smulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; AVX1-NEXT: Cost Model: Found costs of 65 for: %V32I8 = call <32 x i8> @llvm.smulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; AVX1-NEXT: Cost Model: Found costs of 130 for: %V64I8 = call <64 x i8> @llvm.smulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; AVX1-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; AVX2-LABEL: 'smulh'
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.smulh.i64(i64 undef, i64 undef)
+; AVX2-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.smulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; AVX2-NEXT: Cost Model: Found costs of 9 for: %V4I64 = call <4 x i64> @llvm.smulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; AVX2-NEXT: Cost Model: Found costs of 18 for: %V8I64 = call <8 x i64> @llvm.smulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.smulh.i32(i32 undef, i32 undef)
+; AVX2-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.smulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; AVX2-NEXT: Cost Model: Found costs of 17 for: %V8I32 = call <8 x i32> @llvm.smulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; AVX2-NEXT: Cost Model: Found costs of 34 for: %V16I32 = call <16 x i32> @llvm.smulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.smulh.i16(i16 undef, i16 undef)
+; AVX2-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.smulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; AVX2-NEXT: Cost Model: Found costs of 33 for: %V16I16 = call <16 x i16> @llvm.smulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; AVX2-NEXT: Cost Model: Found costs of 66 for: %V32I16 = call <32 x i16> @llvm.smulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.smulh.i8(i8 undef, i8 undef)
+; AVX2-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.smulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; AVX2-NEXT: Cost Model: Found costs of 65 for: %V32I8 = call <32 x i8> @llvm.smulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; AVX2-NEXT: Cost Model: Found costs of 130 for: %V64I8 = call <64 x i8> @llvm.smulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; AVX2-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; AVX512-LABEL: 'smulh'
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.smulh.i64(i64 undef, i64 undef)
+; AVX512-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.smulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; AVX512-NEXT: Cost Model: Found costs of 9 for: %V4I64 = call <4 x i64> @llvm.smulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; AVX512-NEXT: Cost Model: Found costs of 19 for: %V8I64 = call <8 x i64> @llvm.smulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.smulh.i32(i32 undef, i32 undef)
+; AVX512-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.smulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; AVX512-NEXT: Cost Model: Found costs of 17 for: %V8I32 = call <8 x i32> @llvm.smulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; AVX512-NEXT: Cost Model: Found costs of 35 for: %V16I32 = call <16 x i32> @llvm.smulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.smulh.i16(i16 undef, i16 undef)
+; AVX512-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.smulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; AVX512-NEXT: Cost Model: Found costs of 33 for: %V16I16 = call <16 x i16> @llvm.smulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; AVX512-NEXT: Cost Model: Found costs of 67 for: %V32I16 = call <32 x i16> @llvm.smulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.smulh.i8(i8 undef, i8 undef)
+; AVX512-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.smulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; AVX512-NEXT: Cost Model: Found costs of 65 for: %V32I8 = call <32 x i8> @llvm.smulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; AVX512-NEXT: Cost Model: Found costs of 131 for: %V64I8 = call <64 x i8> @llvm.smulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; AVX512-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+ %I64 = call i64 @llvm.smulh.i64(i64 undef, i64 undef)
+ %V2I64 = call <2 x i64> @llvm.smulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+ %V4I64 = call <4 x i64> @llvm.smulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+ %V8I64 = call <8 x i64> @llvm.smulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+
+ %I32 = call i32 @llvm.smulh.i32(i32 undef, i32 undef)
+ %V4I32 = call <4 x i32> @llvm.smulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+ %V8I32 = call <8 x i32> @llvm.smulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+ %V16I32 = call <16 x i32> @llvm.smulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+
+ %I16 = call i16 @llvm.smulh.i16(i16 undef, i16 undef)
+ %V8I16 = call <8 x i16> @llvm.smulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+ %V16I16 = call <16 x i16> @llvm.smulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+ %V32I16 = call <32 x i16> @llvm.smulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+
+ %I8 = call i8 @llvm.smulh.i8(i8 undef, i8 undef)
+ %V16I8 = call <16 x i8> @llvm.smulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+ %V32I8 = call <32 x i8> @llvm.smulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+ %V64I8 = call <64 x i8> @llvm.smulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+
+ ret i32 undef
+}
+
+define i32 @umulh(i32 %arg) {
+; SSE2-LABEL: 'umulh'
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.umulh.i64(i64 undef, i64 undef)
+; SSE2-NEXT: Cost Model: Found costs of 5 for: %V2I64 = call <2 x i64> @llvm.umulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; SSE2-NEXT: Cost Model: Found costs of 10 for: %V4I64 = call <4 x i64> @llvm.umulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; SSE2-NEXT: Cost Model: Found costs of 20 for: %V8I64 = call <8 x i64> @llvm.umulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.umulh.i32(i32 undef, i32 undef)
+; SSE2-NEXT: Cost Model: Found costs of 11 for: %V4I32 = call <4 x i32> @llvm.umulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; SSE2-NEXT: Cost Model: Found costs of 22 for: %V8I32 = call <8 x i32> @llvm.umulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; SSE2-NEXT: Cost Model: Found costs of 44 for: %V16I32 = call <16 x i32> @llvm.umulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.umulh.i16(i16 undef, i16 undef)
+; SSE2-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.umulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; SSE2-NEXT: Cost Model: Found costs of 32 for: %V16I16 = call <16 x i16> @llvm.umulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; SSE2-NEXT: Cost Model: Found costs of 64 for: %V32I16 = call <32 x i16> @llvm.umulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; SSE2-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.umulh.i8(i8 undef, i8 undef)
+; SSE2-NEXT: Cost Model: Found costs of 47 for: %V16I8 = call <16 x i8> @llvm.umulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; SSE2-NEXT: Cost Model: Found costs of 94 for: %V32I8 = call <32 x i8> @llvm.umulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; SSE2-NEXT: Cost Model: Found costs of 188 for: %V64I8 = call <64 x i8> @llvm.umulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; SSE2-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; SSSE3-LABEL: 'umulh'
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.umulh.i64(i64 undef, i64 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 5 for: %V2I64 = call <2 x i64> @llvm.umulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 10 for: %V4I64 = call <4 x i64> @llvm.umulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 20 for: %V8I64 = call <8 x i64> @llvm.umulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.umulh.i32(i32 undef, i32 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 11 for: %V4I32 = call <4 x i32> @llvm.umulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 22 for: %V8I32 = call <8 x i32> @llvm.umulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 44 for: %V16I32 = call <16 x i32> @llvm.umulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.umulh.i16(i16 undef, i16 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.umulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 32 for: %V16I16 = call <16 x i16> @llvm.umulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 64 for: %V32I16 = call <32 x i16> @llvm.umulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.umulh.i8(i8 undef, i8 undef)
+; SSSE3-NEXT: Cost Model: Found costs of 47 for: %V16I8 = call <16 x i8> @llvm.umulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 94 for: %V32I8 = call <32 x i8> @llvm.umulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; SSSE3-NEXT: Cost Model: Found costs of 188 for: %V64I8 = call <64 x i8> @llvm.umulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; SSSE3-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; SSE42-LABEL: 'umulh'
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.umulh.i64(i64 undef, i64 undef)
+; SSE42-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.umulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; SSE42-NEXT: Cost Model: Found costs of 8 for: %V4I64 = call <4 x i64> @llvm.umulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; SSE42-NEXT: Cost Model: Found costs of 16 for: %V8I64 = call <8 x i64> @llvm.umulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.umulh.i32(i32 undef, i32 undef)
+; SSE42-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.umulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; SSE42-NEXT: Cost Model: Found costs of 16 for: %V8I32 = call <8 x i32> @llvm.umulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; SSE42-NEXT: Cost Model: Found costs of 32 for: %V16I32 = call <16 x i32> @llvm.umulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.umulh.i16(i16 undef, i16 undef)
+; SSE42-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.umulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; SSE42-NEXT: Cost Model: Found costs of 32 for: %V16I16 = call <16 x i16> @llvm.umulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; SSE42-NEXT: Cost Model: Found costs of 64 for: %V32I16 = call <32 x i16> @llvm.umulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; SSE42-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.umulh.i8(i8 undef, i8 undef)
+; SSE42-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.umulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; SSE42-NEXT: Cost Model: Found costs of 64 for: %V32I8 = call <32 x i8> @llvm.umulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; SSE42-NEXT: Cost Model: Found costs of 128 for: %V64I8 = call <64 x i8> @llvm.umulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; SSE42-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; AVX1-LABEL: 'umulh'
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.umulh.i64(i64 undef, i64 undef)
+; AVX1-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.umulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; AVX1-NEXT: Cost Model: Found costs of 9 for: %V4I64 = call <4 x i64> @llvm.umulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; AVX1-NEXT: Cost Model: Found costs of 18 for: %V8I64 = call <8 x i64> @llvm.umulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.umulh.i32(i32 undef, i32 undef)
+; AVX1-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.umulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; AVX1-NEXT: Cost Model: Found costs of 17 for: %V8I32 = call <8 x i32> @llvm.umulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; AVX1-NEXT: Cost Model: Found costs of 34 for: %V16I32 = call <16 x i32> @llvm.umulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.umulh.i16(i16 undef, i16 undef)
+; AVX1-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.umulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; AVX1-NEXT: Cost Model: Found costs of 33 for: %V16I16 = call <16 x i16> @llvm.umulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; AVX1-NEXT: Cost Model: Found costs of 66 for: %V32I16 = call <32 x i16> @llvm.umulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; AVX1-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.umulh.i8(i8 undef, i8 undef)
+; AVX1-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.umulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; AVX1-NEXT: Cost Model: Found costs of 65 for: %V32I8 = call <32 x i8> @llvm.umulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; AVX1-NEXT: Cost Model: Found costs of 130 for: %V64I8 = call <64 x i8> @llvm.umulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; AVX1-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; AVX2-LABEL: 'umulh'
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.umulh.i64(i64 undef, i64 undef)
+; AVX2-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.umulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; AVX2-NEXT: Cost Model: Found costs of 9 for: %V4I64 = call <4 x i64> @llvm.umulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; AVX2-NEXT: Cost Model: Found costs of 18 for: %V8I64 = call <8 x i64> @llvm.umulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.umulh.i32(i32 undef, i32 undef)
+; AVX2-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.umulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; AVX2-NEXT: Cost Model: Found costs of 17 for: %V8I32 = call <8 x i32> @llvm.umulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; AVX2-NEXT: Cost Model: Found costs of 34 for: %V16I32 = call <16 x i32> @llvm.umulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.umulh.i16(i16 undef, i16 undef)
+; AVX2-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.umulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; AVX2-NEXT: Cost Model: Found costs of 33 for: %V16I16 = call <16 x i16> @llvm.umulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; AVX2-NEXT: Cost Model: Found costs of 66 for: %V32I16 = call <32 x i16> @llvm.umulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; AVX2-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.umulh.i8(i8 undef, i8 undef)
+; AVX2-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.umulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; AVX2-NEXT: Cost Model: Found costs of 65 for: %V32I8 = call <32 x i8> @llvm.umulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; AVX2-NEXT: Cost Model: Found costs of 130 for: %V64I8 = call <64 x i8> @llvm.umulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; AVX2-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+; AVX512-LABEL: 'umulh'
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I64 = call i64 @llvm.umulh.i64(i64 undef, i64 undef)
+; AVX512-NEXT: Cost Model: Found costs of 4 for: %V2I64 = call <2 x i64> @llvm.umulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+; AVX512-NEXT: Cost Model: Found costs of 9 for: %V4I64 = call <4 x i64> @llvm.umulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+; AVX512-NEXT: Cost Model: Found costs of 19 for: %V8I64 = call <8 x i64> @llvm.umulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I32 = call i32 @llvm.umulh.i32(i32 undef, i32 undef)
+; AVX512-NEXT: Cost Model: Found costs of 8 for: %V4I32 = call <4 x i32> @llvm.umulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+; AVX512-NEXT: Cost Model: Found costs of 17 for: %V8I32 = call <8 x i32> @llvm.umulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+; AVX512-NEXT: Cost Model: Found costs of 35 for: %V16I32 = call <16 x i32> @llvm.umulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I16 = call i16 @llvm.umulh.i16(i16 undef, i16 undef)
+; AVX512-NEXT: Cost Model: Found costs of 16 for: %V8I16 = call <8 x i16> @llvm.umulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+; AVX512-NEXT: Cost Model: Found costs of 33 for: %V16I16 = call <16 x i16> @llvm.umulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+; AVX512-NEXT: Cost Model: Found costs of 67 for: %V32I16 = call <32 x i16> @llvm.umulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+; AVX512-NEXT: Cost Model: Found costs of 1 for: %I8 = call i8 @llvm.umulh.i8(i8 undef, i8 undef)
+; AVX512-NEXT: Cost Model: Found costs of 32 for: %V16I8 = call <16 x i8> @llvm.umulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+; AVX512-NEXT: Cost Model: Found costs of 65 for: %V32I8 = call <32 x i8> @llvm.umulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+; AVX512-NEXT: Cost Model: Found costs of 131 for: %V64I8 = call <64 x i8> @llvm.umulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+; AVX512-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 undef
+;
+ %I64 = call i64 @llvm.umulh.i64(i64 undef, i64 undef)
+ %V2I64 = call <2 x i64> @llvm.umulh.v2i64(<2 x i64> undef, <2 x i64> undef)
+ %V4I64 = call <4 x i64> @llvm.umulh.v4i64(<4 x i64> undef, <4 x i64> undef)
+ %V8I64 = call <8 x i64> @llvm.umulh.v8i64(<8 x i64> undef, <8 x i64> undef)
+
+ %I32 = call i32 @llvm.umulh.i32(i32 undef, i32 undef)
+ %V4I32 = call <4 x i32> @llvm.umulh.v4i32(<4 x i32> undef, <4 x i32> undef)
+ %V8I32 = call <8 x i32> @llvm.umulh.v8i32(<8 x i32> undef, <8 x i32> undef)
+ %V16I32 = call <16 x i32> @llvm.umulh.v16i32(<16 x i32> undef, <16 x i32> undef)
+
+ %I16 = call i16 @llvm.umulh.i16(i16 undef, i16 undef)
+ %V8I16 = call <8 x i16> @llvm.umulh.v8i16(<8 x i16> undef, <8 x i16> undef)
+ %V16I16 = call <16 x i16> @llvm.umulh.v16i16(<16 x i16> undef, <16 x i16> undef)
+ %V32I16 = call <32 x i16> @llvm.umulh.v32i16(<32 x i16> undef, <32 x i16> undef)
+
+ %I8 = call i8 @llvm.umulh.i8(i8 undef, i8 undef)
+ %V16I8 = call <16 x i8> @llvm.umulh.v16i8(<16 x i8> undef, <16 x i8> undef)
+ %V32I8 = call <32 x i8> @llvm.umulh.v32i8(<32 x i8> undef, <32 x i8> undef)
+ %V64I8 = call <64 x i8> @llvm.umulh.v64i8(<64 x i8> undef, <64 x i8> undef)
+
+ ret i32 undef
+}
More information about the llvm-commits
mailing list