[CostModel][X86] Replace CostKindCosts constructor with default values.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 31 Aug 2022 09:02:38 +0000 (10:02 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 31 Aug 2022 09:44:44 +0000 (10:44 +0100)
This improves static initialization of the cost tables and significantly speeds up MSVC compile time.

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

index 91273f2..0dab518 100644 (file)
@@ -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 {