[llvm] 21f36e3 - [CostModel][X86] Add PCLMUL cost table (#211113)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 03:24:43 PDT 2026


Author: Sean Clarke
Date: 2026-07-23T10:24:37Z
New Revision: 21f36e37286479a619d7010d938a97f50240e4c7

URL: https://github.com/llvm/llvm-project/commit/21f36e37286479a619d7010d938a97f50240e4c7
DIFF: https://github.com/llvm/llvm-project/commit/21f36e37286479a619d7010d938a97f50240e4c7.diff

LOG: [CostModel][X86] Add PCLMUL cost table (#211113)

The current cost modeling for X86 does not have `ISD::CLMUL` listed in
any cost table, so the cost for `llvm.clmul` falls back to the default
for `Custom`, which is twice the type legalization cost. Since `CLMUL`
uses the `xmm` registers with `pclmulqdq`, this operation is typically
much more expensive. Add a new table for PCLMUL to reflect this.

Note that AVX, AVX512, and VPCLMULQDQ are still not modeled correctly.
This is left as a FIXME for now.

Assisted-by: Claude Opus 4.8

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    llvm/test/Analysis/CostModel/X86/clmul.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 188c8f76b8e38..421a2829cb509 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -4496,6 +4496,14 @@ X86TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     { ISD::CTPOP,      MVT::i16,     {  1,  1,  2,  2 } }, // popcnt(zext())
     { ISD::CTPOP,      MVT::i8,      {  1,  1,  2,  2 } }, // popcnt(zext())
   };
+  static const CostKindTblEntry PCLMULCostTbl[] = {
+    { ISD::CLMUL,      MVT::v2i64,   {  3, 12,  4,  8 } }, // MOV+2xPCLMUL+unpack
+    { ISD::CLMUL,      MVT::v4i32,   {  8, 18, 12, 16 } }, // MOV+4xPCLMUL+unpack
+    { ISD::CLMUL,      MVT::i64,     {  3, 12,  4,  8 } }, // MOV+PCLMUL+MOV
+    { ISD::CLMUL,      MVT::i32,     {  3, 12,  4,  8 } }, // MOV+PCLMUL+MOV
+    { ISD::CLMUL,      MVT::i16,     {  3, 12,  4,  8 } }, // MOV+PCLMUL+MOV
+    { ISD::CLMUL,      MVT::i8,      {  3, 12,  4,  8 } }, // MOV+PCLMUL+MOV
+  };
   static const CostKindTblEntry X64CostTbl[] = { // 64-bit targets
     { ISD::ABS,        MVT::i64,     {  1,  2,  3,  3 } }, // SUB+CMOV
     { ISD::BITREVERSE, MVT::i64,     { 10, 12, 20, 22 } },
@@ -4718,6 +4726,9 @@ X86TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     ISD = ISD::UMULO;
     OpTy = RetTy->getContainedType(0);
     break;
+  case Intrinsic::clmul:
+    ISD = ISD::CLMUL;
+    break;
   }
 
   if (ISD != ISD::DELETED_NODE) {
@@ -4889,6 +4900,12 @@ X86TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
           return adjustTableCost(Entry->ISD, *KindCost, LT, ICA.getFlags());
     }
 
+    // FIXME: PCLMUL w/ AVX/AVX512 and VPCLMULQDQ are not handled properly.
+    if (ST->hasPCLMUL())
+      if (const auto *Entry = CostTableLookup(PCLMULCostTbl, ISD, MTy))
+        if (auto KindCost = Entry->Cost[CostKind])
+          return adjustTableCost(Entry->ISD, *KindCost, LT, ICA.getFlags());
+
     if (ST->is64Bit())
       if (const auto *Entry = CostTableLookup(X64CostTbl, ISD, MTy))
         if (auto KindCost = Entry->Cost[CostKind])

diff  --git a/llvm/test/Analysis/CostModel/X86/clmul.ll b/llvm/test/Analysis/CostModel/X86/clmul.ll
index 8e5c71b311ea9..19f9240ff0cb4 100644
--- a/llvm/test/Analysis/CostModel/X86/clmul.ll
+++ b/llvm/test/Analysis/CostModel/X86/clmul.ll
@@ -1,24 +1,24 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
-; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=x86_64-unknown-linux-gnu -mattr=+pclmul | FileCheck %s --check-prefix=PCLMUL
-; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=x86_64-unknown-linux-gnu -mattr=-pclmul | FileCheck %s --check-prefix=NO-PCLMUL
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-unknown-linux-gnu -mattr=+pclmul | FileCheck %s --check-prefix=PCLMUL
+; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=x86_64-unknown-linux-gnu -mattr=-pclmul | FileCheck %s --check-prefix=NO-PCLMUL
 
 
 define void @clmul(i128 %a128, i128 %b128, i64 %a64, i64 %b64, i32 %a32, i32 %b32, i16 %a16, i16 %b16, i8 %a8, i8 %b8) {
 ; PCLMUL-LABEL: 'clmul'
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %call_i128 = call i128 @llvm.clmul.i128(i128 %a128, i128 %b128)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %call_i64 = call i64 @llvm.clmul.i64(i64 %a64, i64 %b64)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %call_i32 = call i32 @llvm.clmul.i32(i32 %a32, i32 %b32)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %call_i16 = call i16 @llvm.clmul.i16(i16 %a16, i16 %b16)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %call_i8 = call i8 @llvm.clmul.i8(i8 %a8, i8 %b8)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:6 CodeSize:8 Lat:24 SizeLat:16 for: %call_i128 = call i128 @llvm.clmul.i128(i128 %a128, i128 %b128)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:3 CodeSize:4 Lat:12 SizeLat:8 for: %call_i64 = call i64 @llvm.clmul.i64(i64 %a64, i64 %b64)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:3 CodeSize:4 Lat:12 SizeLat:8 for: %call_i32 = call i32 @llvm.clmul.i32(i32 %a32, i32 %b32)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:3 CodeSize:4 Lat:12 SizeLat:8 for: %call_i16 = call i16 @llvm.clmul.i16(i16 %a16, i16 %b16)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:3 CodeSize:4 Lat:12 SizeLat:8 for: %call_i8 = call i8 @llvm.clmul.i8(i8 %a8, i8 %b8)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; NO-PCLMUL-LABEL: 'clmul'
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 768 for instruction: %call_i128 = call i128 @llvm.clmul.i128(i128 %a128, i128 %b128)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 59 for instruction: %call_i64 = call i64 @llvm.clmul.i64(i64 %a64, i64 %b64)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 43 for instruction: %call_i32 = call i32 @llvm.clmul.i32(i32 %a32, i32 %b32)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %call_i16 = call i16 @llvm.clmul.i16(i16 %a16, i16 %b16)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %call_i8 = call i8 @llvm.clmul.i8(i8 %a8, i8 %b8)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:768 CodeSize:768 Lat:640 SizeLat:640 for: %call_i128 = call i128 @llvm.clmul.i128(i128 %a128, i128 %b128)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:59 CodeSize:43 Lat:123 SizeLat:59 for: %call_i64 = call i64 @llvm.clmul.i64(i64 %a64, i64 %b64)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:43 CodeSize:43 Lat:91 SizeLat:43 for: %call_i32 = call i32 @llvm.clmul.i32(i32 %a32, i32 %b32)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of 48 for: %call_i16 = call i16 @llvm.clmul.i16(i16 %a16, i16 %b16)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of 24 for: %call_i8 = call i8 @llvm.clmul.i8(i8 %a8, i8 %b8)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
   %call_i128 = call i128 @llvm.clmul.i128(i128 %a128, i128 %b128)
   %call_i64 = call i64 @llvm.clmul.i64(i64 %a64, i64 %b64)
@@ -30,20 +30,20 @@ define void @clmul(i128 %a128, i128 %b128, i64 %a64, i64 %b64, i32 %a32, i32 %b3
 
 define void @clmul_128(<1 x i128> %a128, <1 x i128> %b128, <2 x i64> %a64, <2 x i64> %b64, <4 x i32> %a32, <4 x i32> %b32, <8 x i16> %a16, <8 x i16> %b16, <16 x i8> %a8, <16 x i8> %b8) {
 ; PCLMUL-LABEL: 'clmul_128'
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %call_i128 = call <1 x i128> @llvm.clmul.v1i128(<1 x i128> %a128, <1 x i128> %b128)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %call_i64 = call <2 x i64> @llvm.clmul.v2i64(<2 x i64> %a64, <2 x i64> %b64)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %call_i32 = call <4 x i32> @llvm.clmul.v4i32(<4 x i32> %a32, <4 x i32> %b32)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %call_i16 = call <8 x i16> @llvm.clmul.v8i16(<8 x i16> %a16, <8 x i16> %b16)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %call_i8 = call <16 x i8> @llvm.clmul.v16i8(<16 x i8> %a8, <16 x i8> %b8)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:6 CodeSize:8 Lat:24 SizeLat:16 for: %call_i128 = call <1 x i128> @llvm.clmul.v1i128(<1 x i128> %a128, <1 x i128> %b128)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:3 CodeSize:4 Lat:12 SizeLat:8 for: %call_i64 = call <2 x i64> @llvm.clmul.v2i64(<2 x i64> %a64, <2 x i64> %b64)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:8 CodeSize:12 Lat:18 SizeLat:16 for: %call_i32 = call <4 x i32> @llvm.clmul.v4i32(<4 x i32> %a32, <4 x i32> %b32)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:48 CodeSize:48 Lat:80 SizeLat:48 for: %call_i16 = call <8 x i16> @llvm.clmul.v8i16(<8 x i16> %a16, <8 x i16> %b16)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:48 Lat:40 SizeLat:48 for: %call_i8 = call <16 x i8> @llvm.clmul.v16i8(<16 x i8> %a8, <16 x i8> %b8)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; NO-PCLMUL-LABEL: 'clmul_128'
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 768 for instruction: %call_i128 = call <1 x i128> @llvm.clmul.v1i128(<1 x i128> %a128, <1 x i128> %b128)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 139 for instruction: %call_i64 = call <2 x i64> @llvm.clmul.v2i64(<2 x i64> %a64, <2 x i64> %b64)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 123 for instruction: %call_i32 = call <4 x i32> @llvm.clmul.v4i32(<4 x i32> %a32, <4 x i32> %b32)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %call_i16 = call <8 x i16> @llvm.clmul.v8i16(<8 x i16> %a16, <8 x i16> %b16)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: %call_i8 = call <16 x i8> @llvm.clmul.v16i8(<16 x i8> %a8, <16 x i8> %b8)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:768 CodeSize:768 Lat:640 SizeLat:640 for: %call_i128 = call <1 x i128> @llvm.clmul.v1i128(<1 x i128> %a128, <1 x i128> %b128)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:139 CodeSize:187 Lat:187 SizeLat:187 for: %call_i64 = call <2 x i64> @llvm.clmul.v2i64(<2 x i64> %a64, <2 x i64> %b64)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:123 CodeSize:139 Lat:155 SizeLat:139 for: %call_i32 = call <4 x i32> @llvm.clmul.v4i32(<4 x i32> %a32, <4 x i32> %b32)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:48 CodeSize:48 Lat:80 SizeLat:48 for: %call_i16 = call <8 x i16> @llvm.clmul.v8i16(<8 x i16> %a16, <8 x i16> %b16)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:40 CodeSize:48 Lat:40 SizeLat:48 for: %call_i8 = call <16 x i8> @llvm.clmul.v16i8(<16 x i8> %a8, <16 x i8> %b8)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
   %call_i128 = call <1 x i128> @llvm.clmul.v1i128(<1 x i128> %a128, <1 x i128> %b128)
   %call_i64 = call <2 x i64> @llvm.clmul.v2i64(<2 x i64> %a64, <2 x i64> %b64)
@@ -55,20 +55,20 @@ define void @clmul_128(<1 x i128> %a128, <1 x i128> %b128, <2 x i64> %a64, <2 x
 
 define void @clmul_256(<2 x i128> %a128, <2 x i128> %b128, <4 x i64> %a64, <4 x i64> %b64, <8 x i32> %a32, <8 x i32> %b32, <16 x i16> %a16, <16 x i16> %b16, <32 x i8> %a8, <32 x i8> %b8) {
 ; PCLMUL-LABEL: 'clmul_256'
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %call_i128 = call <2 x i128> @llvm.clmul.v2i128(<2 x i128> %a128, <2 x i128> %b128)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %call_i64 = call <4 x i64> @llvm.clmul.v4i64(<4 x i64> %a64, <4 x i64> %b64)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %call_i32 = call <8 x i32> @llvm.clmul.v8i32(<8 x i32> %a32, <8 x i32> %b32)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %call_i16 = call <16 x i16> @llvm.clmul.v16i16(<16 x i16> %a16, <16 x i16> %b16)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %call_i8 = call <32 x i8> @llvm.clmul.v32i8(<32 x i8> %a8, <32 x i8> %b8)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:12 CodeSize:16 Lat:48 SizeLat:32 for: %call_i128 = call <2 x i128> @llvm.clmul.v2i128(<2 x i128> %a128, <2 x i128> %b128)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:6 CodeSize:8 Lat:24 SizeLat:16 for: %call_i64 = call <4 x i64> @llvm.clmul.v4i64(<4 x i64> %a64, <4 x i64> %b64)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:16 CodeSize:24 Lat:36 SizeLat:32 for: %call_i32 = call <8 x i32> @llvm.clmul.v8i32(<8 x i32> %a32, <8 x i32> %b32)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:96 CodeSize:96 Lat:160 SizeLat:96 for: %call_i16 = call <16 x i16> @llvm.clmul.v16i16(<16 x i16> %a16, <16 x i16> %b16)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:80 CodeSize:96 Lat:80 SizeLat:96 for: %call_i8 = call <32 x i8> @llvm.clmul.v32i8(<32 x i8> %a8, <32 x i8> %b8)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; NO-PCLMUL-LABEL: 'clmul_256'
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 1536 for instruction: %call_i128 = call <2 x i128> @llvm.clmul.v2i128(<2 x i128> %a128, <2 x i128> %b128)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 1152 for instruction: %call_i64 = call <4 x i64> @llvm.clmul.v4i64(<4 x i64> %a64, <4 x i64> %b64)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 320 for instruction: %call_i32 = call <8 x i32> @llvm.clmul.v8i32(<8 x i32> %a32, <8 x i32> %b32)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %call_i16 = call <16 x i16> @llvm.clmul.v16i16(<16 x i16> %a16, <16 x i16> %b16)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 80 for instruction: %call_i8 = call <32 x i8> @llvm.clmul.v32i8(<32 x i8> %a8, <32 x i8> %b8)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:1536 CodeSize:1536 Lat:1152 SizeLat:1152 for: %call_i128 = call <2 x i128> @llvm.clmul.v2i128(<2 x i128> %a128, <2 x i128> %b128)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:1152 CodeSize:1280 Lat:1024 SizeLat:1280 for: %call_i64 = call <4 x i64> @llvm.clmul.v4i64(<4 x i64> %a64, <4 x i64> %b64)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:320 CodeSize:384 Lat:320 SizeLat:384 for: %call_i32 = call <8 x i32> @llvm.clmul.v8i32(<8 x i32> %a32, <8 x i32> %b32)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:96 CodeSize:96 Lat:160 SizeLat:96 for: %call_i16 = call <16 x i16> @llvm.clmul.v16i16(<16 x i16> %a16, <16 x i16> %b16)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:80 CodeSize:96 Lat:80 SizeLat:96 for: %call_i8 = call <32 x i8> @llvm.clmul.v32i8(<32 x i8> %a8, <32 x i8> %b8)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
   %call_i128 = call <2 x i128> @llvm.clmul.v2i128(<2 x i128> %a128, <2 x i128> %b128)
   %call_i64 = call <4 x i64> @llvm.clmul.v4i64(<4 x i64> %a64, <4 x i64> %b64)
@@ -80,20 +80,20 @@ define void @clmul_256(<2 x i128> %a128, <2 x i128> %b128, <4 x i64> %a64, <4 x
 
 define void @clmul_512(<4 x i128> %a128, <4 x i128> %b128, <8 x i64> %a64, <8 x i64> %b64, <16 x i32> %a32, <16 x i32> %b32, <32 x i16> %a16, <32 x i16> %b16, <64 x i8> %a8, <64 x i8> %b8) {
 ; PCLMUL-LABEL: 'clmul_512'
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %call_i128 = call <4 x i128> @llvm.clmul.v4i128(<4 x i128> %a128, <4 x i128> %b128)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %call_i64 = call <8 x i64> @llvm.clmul.v8i64(<8 x i64> %a64, <8 x i64> %b64)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %call_i32 = call <16 x i32> @llvm.clmul.v16i32(<16 x i32> %a32, <16 x i32> %b32)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %call_i16 = call <32 x i16> @llvm.clmul.v32i16(<32 x i16> %a16, <32 x i16> %b16)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %call_i8 = call <64 x i8> @llvm.clmul.v64i8(<64 x i8> %a8, <64 x i8> %b8)
-; PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:24 CodeSize:32 Lat:96 SizeLat:64 for: %call_i128 = call <4 x i128> @llvm.clmul.v4i128(<4 x i128> %a128, <4 x i128> %b128)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:12 CodeSize:16 Lat:48 SizeLat:32 for: %call_i64 = call <8 x i64> @llvm.clmul.v8i64(<8 x i64> %a64, <8 x i64> %b64)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:32 CodeSize:48 Lat:72 SizeLat:64 for: %call_i32 = call <16 x i32> @llvm.clmul.v16i32(<16 x i32> %a32, <16 x i32> %b32)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:192 CodeSize:192 Lat:320 SizeLat:192 for: %call_i16 = call <32 x i16> @llvm.clmul.v32i16(<32 x i16> %a16, <32 x i16> %b16)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:160 CodeSize:192 Lat:160 SizeLat:192 for: %call_i8 = call <64 x i8> @llvm.clmul.v64i8(<64 x i8> %a8, <64 x i8> %b8)
+; PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
 ; NO-PCLMUL-LABEL: 'clmul_512'
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 3072 for instruction: %call_i128 = call <4 x i128> @llvm.clmul.v4i128(<4 x i128> %a128, <4 x i128> %b128)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 2304 for instruction: %call_i64 = call <8 x i64> @llvm.clmul.v8i64(<8 x i64> %a64, <8 x i64> %b64)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 640 for instruction: %call_i32 = call <16 x i32> @llvm.clmul.v16i32(<16 x i32> %a32, <16 x i32> %b32)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 192 for instruction: %call_i16 = call <32 x i16> @llvm.clmul.v32i16(<32 x i16> %a16, <32 x i16> %b16)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 160 for instruction: %call_i8 = call <64 x i8> @llvm.clmul.v64i8(<64 x i8> %a8, <64 x i8> %b8)
-; NO-PCLMUL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:3072 CodeSize:3072 Lat:2176 SizeLat:2176 for: %call_i128 = call <4 x i128> @llvm.clmul.v4i128(<4 x i128> %a128, <4 x i128> %b128)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:2304 CodeSize:2560 Lat:2048 SizeLat:2560 for: %call_i64 = call <8 x i64> @llvm.clmul.v8i64(<8 x i64> %a64, <8 x i64> %b64)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:640 CodeSize:768 Lat:640 SizeLat:768 for: %call_i32 = call <16 x i32> @llvm.clmul.v16i32(<16 x i32> %a32, <16 x i32> %b32)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:192 CodeSize:192 Lat:320 SizeLat:192 for: %call_i16 = call <32 x i16> @llvm.clmul.v32i16(<32 x i16> %a16, <32 x i16> %b16)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:160 CodeSize:192 Lat:160 SizeLat:192 for: %call_i8 = call <64 x i8> @llvm.clmul.v64i8(<64 x i8> %a8, <64 x i8> %b8)
+; NO-PCLMUL-NEXT:  Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret void
 ;
   %call_i128 = call <4 x i128> @llvm.clmul.v4i128(<4 x i128> %a128, <4 x i128> %b128)
   %call_i64 = call <8 x i64> @llvm.clmul.v8i64(<8 x i64> %a64, <8 x i64> %b64)


        


More information about the llvm-commits mailing list