[llvm] [Analysis] Add Intrinsics::CLMUL case to cost calculations to getIntrinsicInstrCost / getTypeBasedIntrinsicInstrCost (PR #176552)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 22 08:05:12 PST 2026
================
@@ -0,0 +1,19 @@
+; 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
+
+define void @clmul(i64 %a64, i64 %b64, i32 %a32, i32 %b32, i8 %a8, i8 %b8) {
+; CHECK-LABEL: 'clmul'
+; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %call_i64 = call i64 @llvm.clmul.i64(i64 %a64, i64 %b64)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %call_i32 = call i32 @llvm.clmul.i32(i32 %a32, i32 %b32)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %call_i8 = call i8 @llvm.clmul.i8(i8 %a8, i8 %b8)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
+;
+ %call_i64 = call i64 @llvm.clmul.i64(i64 %a64, i64 %b64)
+ %call_i32 = call i32 @llvm.clmul.i32(i32 %a32, i32 %b32)
+ %call_i8 = call i8 @llvm.clmul.i8(i8 %a8, i8 %b8)
+ ret void
+}
+
+declare i64 @llvm.clmul.i64(i64, i64)
+declare i32 @llvm.clmul.i32(i32, i32)
+declare i8 @llvm.clmul.i8(i8, i8)
----------------
RKSimon wrote:
these shouldn't be necessary anymore?
https://github.com/llvm/llvm-project/pull/176552
More information about the llvm-commits
mailing list