llvm.org GIT mirror llvm / c4a6700
[ProfData] Remove global constructor from ProfileSummaryBuilder. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271021 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 4 years ago
2 changed file(s) with 10 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
6262
6363 public:
6464 /// \brief A vector of useful cutoff values for detailed summary.
65 static const std::vector DefaultCutoffs;
65 static const ArrayRef DefaultCutoffs;
6666 };
6767
6868 class InstrProfSummaryBuilder final : public ProfileSummaryBuilder {
7272
7373 public:
7474 InstrProfSummaryBuilder(std::vector Cutoffs)
75 : ProfileSummaryBuilder(Cutoffs), MaxInternalBlockCount(0) {}
75 : ProfileSummaryBuilder(std::move(Cutoffs)), MaxInternalBlockCount(0) {}
7676 void addRecord(const InstrProfRecord &);
7777 std::unique_ptr getSummary();
7878 };
8282 public:
8383 void addRecord(const sampleprof::FunctionSamples &FS);
8484 SampleProfileSummaryBuilder(std::vector Cutoffs)
85 : ProfileSummaryBuilder(Cutoffs) {}
85 : ProfileSummaryBuilder(std::move(Cutoffs)) {}
8686 std::unique_ptr getSummary();
8787 };
8888
2424
2525 // A set of cutoff values. Each value, when divided by ProfileSummary::Scale
2626 // (which is 1000000) is a desired percentile of total counts.
27 const std::vector ProfileSummaryBuilder::DefaultCutoffs(
28 {10000, /* 1% */
29 100000, /* 10% */
30 200000, 300000, 400000, 500000, 600000, 500000, 600000, 700000, 800000,
31 900000, 950000, 990000, 999000, 999900, 999990, 999999});
27 static const uint32_t DefaultCutoffsData[] = {
28 10000, /* 1% */
29 100000, /* 10% */
30 200000, 300000, 400000, 500000, 600000, 500000, 600000, 700000,
31 800000, 900000, 950000, 990000, 999000, 999900, 999990, 999999};
32 const ArrayRef ProfileSummaryBuilder::DefaultCutoffs =
33 DefaultCutoffsData;
3234
3335 void InstrProfSummaryBuilder::addRecord(const InstrProfRecord &R) {
3436 // The first counter is not necessarily an entry count for IR