Skip to content

Commit 53e9eee

Browse files
committed
[X86][TTI] Use TargetCostConstants Free/Basic values instead of hard coded 0/1 to make the costs calculation more obvious. NFC.
1 parent 4971e53 commit 53e9eee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ InstructionCost X86TTIImpl::getShuffleCost(
15841584
if (Kind == TTI::SK_ExtractSubvector && LT.second.isVector()) {
15851585
int NumElts = LT.second.getVectorNumElements();
15861586
if ((Index % NumElts) == 0)
1587-
return 0;
1587+
return TTI::TCC_Free;
15881588
std::pair<InstructionCost, MVT> SubLT = getTypeLegalizationCost(SubTp);
15891589
if (SubLT.second.isVector()) {
15901590
int NumSubElts = SubLT.second.getVectorNumElements();
@@ -4763,7 +4763,7 @@ InstructionCost X86TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
47634763

47644764
// This type is legalized to a scalar type.
47654765
if (!LT.second.isVector())
4766-
return 0;
4766+
return TTI::TCC_Free;
47674767

47684768
// The type may be split. Normalize the index to the new type.
47694769
unsigned SizeInBits = LT.second.getSizeInBits();
@@ -6030,9 +6030,9 @@ InstructionCost X86TTIImpl::getCFInstrCost(unsigned Opcode,
60306030
TTI::TargetCostKind CostKind,
60316031
const Instruction *I) {
60326032
if (CostKind != TTI::TCK_RecipThroughput)
6033-
return Opcode == Instruction::PHI ? 0 : 1;
6033+
return Opcode == Instruction::PHI ? TTI::TCC_Free : TTI::TCC_Basic;
60346034
// Branches are assumed to be predicted.
6035-
return 0;
6035+
return TTI::TCC_Free;
60366036
}
60376037

60386038
int X86TTIImpl::getGatherOverhead() const {

0 commit comments

Comments
 (0)