Skip to content

Commit e0f6106

Browse files
committed
Fix ppc matrix.ll test
1 parent 1a43029 commit e0f6106

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

llvm/lib/Analysis/CostModel.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ static cl::opt<bool> TypeBasedIntrinsicCost("type-based-intrinsic-cost",
4444
cl::desc("Calculate intrinsics cost based only on argument types"),
4545
cl::init(false));
4646

47+
static cl::opt<bool> LibCallBasedIntrinsicCost(
48+
"libcall-based-intrinsic-cost",
49+
cl::desc("Calculate intrinsics cost using target library info"),
50+
cl::init(false));
51+
4752
#define CM_NAME "cost-model"
4853
#define DEBUG_TYPE CM_NAME
4954

@@ -58,7 +63,7 @@ PreservedAnalyses CostModelPrinterPass::run(Function &F,
5863
// which cost kind to print.
5964
InstructionCost Cost;
6065
auto *II = dyn_cast<IntrinsicInst>(&Inst);
61-
if (II) {
66+
if (II && (LibCallBasedIntrinsicCost || TypeBasedIntrinsicCost)) {
6267
IntrinsicCostAttributes ICA(
6368
II->getIntrinsicID(), *II, InstructionCost::getInvalid(),
6469
/*TypeBasedOnly=*/TypeBasedIntrinsicCost, &TLI);

llvm/test/Analysis/CostModel/AArch64/sincos.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "sincos"
22
; RUN: opt < %s -mtriple=aarch64-gnu-linux -mattr=+neon,+sve -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s
3-
; RUN: opt < %s -mtriple=aarch64-gnu-linux -mattr=+neon,+sve -vector-library=ArmPL -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s -check-prefix=CHECK-VECLIB
3+
; RUN: opt < %s -mtriple=aarch64-gnu-linux -mattr=+neon,+sve -vector-library=ArmPL -passes="print<cost-model>" -libcall-based-intrinsic-cost -cost-kind=throughput 2>&1 -disable-output | FileCheck %s -check-prefix=CHECK-VECLIB
44

55
define void @sincos(
66
; CHECK-LABEL: 'sincos'

0 commit comments

Comments
 (0)