[llvm] f698c21 - [X86][NFC]Move and rephrase the comment, NFC
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 04:35:37 PST 2023
Author: Alexey Bataev
Date: 2023-01-10T04:35:11-08:00
New Revision: f698c2134503e6722a0da33c5e68e0df166579a2
URL: https://github.com/llvm/llvm-project/commit/f698c2134503e6722a0da33c5e68e0df166579a2
DIFF: https://github.com/llvm/llvm-project/commit/f698c2134503e6722a0da33c5e68e0df166579a2.diff
LOG: [X86][NFC]Move and rephrase the comment, NFC
Added:
Modified:
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 5b6c7d86cebe4..d153fb9c310c1 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -4333,6 +4333,8 @@ InstructionCost X86TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
MVT MScalarTy = LT.second.getScalarType();
auto IsCheapPInsrPExtrInsertPS = [&]() {
+ // Assume pinsr/pextr XMM <-> GPR is relatively cheap on all targets.
+ // Also, assume insertps is relatively cheap on all >= SSE41 targets.
return (MScalarTy == MVT::i16 && ST->hasSSE2()) ||
(MScalarTy.isInteger() && ST->hasSSE41()) ||
(MScalarTy == MVT::f32 && ST->hasSSE41() &&
@@ -4371,8 +4373,7 @@ InstructionCost X86TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
if (auto *Entry = CostTableLookup(SLMCostTbl, ISD, MScalarTy))
return Entry->Cost + RegisterFileMoveCost;
- // Assume pinsr/pextr XMM <-> GPR is relatively cheap on all targets.
- // Assume insertps is relatively cheap on all targets.
+ // Consider cheap cases.
if (IsCheapPInsrPExtrInsertPS())
return 1 + RegisterFileMoveCost;
More information about the llvm-commits
mailing list