[llvm] 1209b9c - [CostModel][X86] Replace CostKindCosts constructor with default values.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 31 02:45:21 PDT 2022
Author: Simon Pilgrim
Date: 2022-08-31T10:44:44+01:00
New Revision: 1209b9c2c2bec5a5ffd68d6785015bfd222ecf00
URL: https://github.com/llvm/llvm-project/commit/1209b9c2c2bec5a5ffd68d6785015bfd222ecf00
DIFF: https://github.com/llvm/llvm-project/commit/1209b9c2c2bec5a5ffd68d6785015bfd222ecf00.diff
LOG: [CostModel][X86] Replace CostKindCosts constructor with default values.
This improves static initialization of the cost tables and significantly speeds up MSVC compile time.
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 91273f2c212ab..0dab5189d4883 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -70,15 +70,10 @@ using namespace llvm;
// Helper struct to store/access costs for each cost kind.
// TODO: Move this to allow other targets to use it?
struct CostKindCosts {
- unsigned RecipThroughputCost;
- unsigned LatencyCost;
- unsigned CodeSizeCost;
- unsigned SizeAndLatencyCost;
-
- CostKindCosts(unsigned RecipThroughput = ~0U, unsigned Latency = ~0U,
- unsigned CodeSize = ~0U, unsigned SizeAndLatency = ~0U)
- : RecipThroughputCost(RecipThroughput), LatencyCost(Latency),
- CodeSizeCost(CodeSize), SizeAndLatencyCost(SizeAndLatency) {}
+ unsigned RecipThroughputCost = ~0U;
+ unsigned LatencyCost = ~0U;
+ unsigned CodeSizeCost = ~0U;
+ unsigned SizeAndLatencyCost = ~0U;
llvm::Optional<unsigned>
operator[](TargetTransformInfo::TargetCostKind Kind) const {
More information about the llvm-commits
mailing list