[all-commits] [llvm/llvm-project] e475d4: [CSSPGO] Fix return value of getProbeWeight

ictwanglei via All-commits all-commits at lists.llvm.org
Fri May 14 14:06:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e475d4d69f04597c3f6c34c8ff1899bf44502a94
      https://github.com/llvm/llvm-project/commit/e475d4d69f04597c3f6c34c8ff1899bf44502a94
  Author: wlei <wlei at fb.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/SampleProfile.cpp

  Log Message:
  -----------
  [CSSPGO] Fix return value of getProbeWeight

Currently we didn't support multiple return type, we work around to use error_code to represent:

1)  The dangling probe.
2)  Ignore the weight of non-probe instruction

While merging the instructions' weight for the whole BB, it will filter out the error code. But If all instructions of the BB give error_code, the outside logic will mark it as a BB requiring the inference algorithm to infer its weight. This is different from the zero value which will be treated as a cold block.

Fix one place that if we can't find the FunctionSamples in the profile data which indicates the BB is cold, we choose to return zero.

Also refine the comments.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D102007




More information about the All-commits mailing list