)]}'
{
  "commit": "ab1008255e37b5b51a433ed69e04c06300543799",
  "tree": "ed0d96d90686965d9ab41850716c5d28b84d29ea",
  "parents": [
    "d1e2e4f9ce4df50564f1244dcea9befc3066faa8"
  ],
  "author": {
    "name": "Martin Jambor",
    "email": "mjambor@suse.cz",
    "time": "Wed Oct 27 14:49:01 2021 +0200"
  },
  "committer": {
    "name": "Martin Jambor",
    "email": "mjambor@suse.cz",
    "time": "Wed Oct 27 15:11:47 2021 +0200"
  },
  "message": "ipa-cp: Select saner profile count to base heuristics on\n\nWhen profile feedback is available, IPA-CP takes the count of the\nhottest node and then evaluates all call contexts relative to it.\nThis means that typically almost no clones for specialized contexts\nare ever created because the maximum is some special function, called\nfrom everywhere (that is likely to get inlined anyway) and all the\nexamined edges look cold compared to it.\n\nThis patch changes the selection.  It simply sorts counts of all edges\neligible for cloning in a vector and then picks the count in 90th\npercentile (the actual number is configurable via a parameter).\n\nI also tried more complex approaches which were summing the counts and\npicking the edge which together with all hotter edges accounted for a\ngiven portion of the total sum of all edge counts.  But first it was\nnot apparently clear to me that they make more logical sense that the\nsimple method and practically I always also had to ignore a few\npercent of the hottest edges with really extreme counts (looking at\nbash and python).  And when I had to do that anyway, it seemed simpler\nto just \"ignore\" more and take the first non-ignored count as the\nbase.\n\nNevertheless, if people think some more sophisticated method should be\nused anyway, I am willing to be persuaded.  But this patch is a clear\nimprovement over the current situation.\n\ngcc/ChangeLog:\n\n2021-10-26  Martin Jambor  \u003cmjambor@suse.cz\u003e\n\n\t* params.opt (param_ipa_cp_profile_count_base): New parameter.\n\t* doc/invoke.texi (Optimize Options): Add entry for\n\tipa-cp-profile-count-base.\n\t* ipa-cp.c (max_count): Replace with base_count, replace all\n\toccurrences too, unless otherwise stated.\n\t(ipcp_cloning_candidate_p): identify mostly-directly called\n\tfunctions based on their counts, not max_count.\n\t(compare_edge_profile_counts): New function.\n\t(ipcp_propagate_stage): Instead of setting max_count, find the\n\tappropriate edge count in a sorted vector of counts of eligible\n\tedges and make it the base_count.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "71992b8c59749f5508a3c6a1b1792910652eac57",
      "old_mode": 33188,
      "old_path": "gcc/doc/invoke.texi",
      "new_id": "b64ec18ae46e744a12577ddeafbe275215a5bf4f",
      "new_mode": 33188,
      "new_path": "gcc/doc/invoke.texi"
    },
    {
      "type": "modify",
      "old_id": "b254b9b9de65313ed6d89833c371dd29466a48dd",
      "old_mode": 33188,
      "old_path": "gcc/ipa-cp.c",
      "new_id": "4d07a6d0a5861f0205a58d5a3f3a7c01233cf0cd",
      "new_mode": 33188,
      "new_path": "gcc/ipa-cp.c"
    },
    {
      "type": "modify",
      "old_id": "6eb3e15a9e685022800f81dfbb8d6e1d8bfac738",
      "old_mode": 33188,
      "old_path": "gcc/params.opt",
      "new_id": "7ee7820f11f973e78b328bf922525accd9c2dbd1",
      "new_mode": 33188,
      "new_path": "gcc/params.opt"
    }
  ]
}
