[all-commits] [llvm/llvm-project] 37d6be: Revert "[BranchProbability] move options for 'like...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sun Mar 21 12:51:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37d6be90524ca1659521ab879aaae5e5501f1e97
      https://github.com/llvm/llvm-project/commit/37d6be90524ca1659521ab879aaae5e5501f1e97
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-03-21 (Sun, 21 Mar 2021)

  Changed paths:
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M llvm/include/llvm/Support/BranchProbability.h
    M llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
    M llvm/lib/Support/BranchProbability.cpp
    M llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp

  Log Message:
  -----------
  Revert "[BranchProbability] move options for 'likely' and 'unlikely'"

Upon reviewing D98898 i've come to realization that these are
implementation detail of LowerExpectIntrinsicPass,
and they should not be exposed to outside of it.

This reverts commit ee8b53815ddf6f6f94ade0068903cd5ae843fafa.


  Commit: e3a470162738871bba982416748ae5f5e3572947
      https://github.com/llvm/llvm-project/commit/e3a470162738871bba982416748ae5f5e3572947
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-03-21 (Sun, 21 Mar 2021)

  Changed paths:
    M clang/lib/CodeGen/CGStmt.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/test/CodeGenCXX/attr-likelihood-iteration-stmt.cpp
    M clang/test/CodeGenCXX/attr-likelihood-switch-branch-weights.cpp
    M llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
    M llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp

  Log Message:
  -----------
  [clang][CodeGen] Lower Likelihood attributes to @llvm.expect intrin instead of branch weights

08196e0b2e1f8aaa8a854585335c17ba479114df exposed LowerExpectIntrinsic's
internal implementation detail in the form of
LikelyBranchWeight/UnlikelyBranchWeight options to the outside.

While this isn't incorrect from the results viewpoint,
this is suboptimal from the layering viewpoint,
and causes confusion - should transforms also use those weights,
or should they use something else, D98898?

So go back to status quo by making LikelyBranchWeight/UnlikelyBranchWeight
internal again, and fixing all the code that used it directly,
which currently is only clang codegen, thankfully,
to emit proper @llvm.expect intrinsics instead.


Compare: https://github.com/llvm/llvm-project/compare/bcaca360f8b6...e3a470162738


More information about the All-commits mailing list