[all-commits] [llvm/llvm-project] 37fb86: Add support of __builtin_expect_with_probability

Erich Keane via All-commits all-commits at lists.llvm.org
Mon Jun 22 10:21:54 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 37fb860301272d8138d289da5b606115b3fe5a13
      https://github.com/llvm/llvm-project/commit/37fb860301272d8138d289da5b606115b3fe5a13
  Author: Zhi Zhuang <Zhi.Zhuang at mediatek.com>
  Date:   2020-06-22 (Mon, 22 Jun 2020)

  Changed paths:
    M clang/include/clang/Basic/Builtins.def
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Sema/SemaChecking.cpp
    A clang/test/CodeGen/builtin-expect-with-probability.cpp
    A clang/test/Sema/builtin-expect-with-probability-avr.cpp
    A clang/test/Sema/builtin-expect-with-probability.cpp
    M llvm/docs/BranchWeightMetadata.rst
    M llvm/docs/LangRef.rst
    M llvm/include/llvm/IR/Intrinsics.td
    M llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
    A llvm/test/Transforms/LowerExpectIntrinsic/expect-with-probability.ll

  Log Message:
  -----------
  Add support of __builtin_expect_with_probability

Add a new builtin-function __builtin_expect_with_probability and
intrinsic llvm.expect.with.probability.
The interface is __builtin_expect_with_probability(long expr, long
expected, double probability).
It is mainly the same as __builtin_expect besides one more argument
indicating the probability of expression equal to expected value. The
probability should be a constant floating-point expression and be in
range [0.0, 1.0] inclusive.
It is similar to builtin-expect-with-probability function in GCC
built-in functions.

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




More information about the All-commits mailing list