[PATCH] D88363: [CodeGen] Improve likelihood attribute branch weights

Mark de Wever via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 26 10:23:17 PDT 2020


Mordante created this revision.
Mordante added reviewers: rsmith, aaron.ballman.
Mordante added a project: clang.
Mordante requested review of this revision.

Bruno De Fraine discovered some issues with D85091 <https://reviews.llvm.org/D85091>. The branch weights generated for `logical not` and `ternary conditional` were wrong. The `logical and` and `logical or` differed from the code generated of `__builtin_predict`.

Adjusted the generated code for the likelihood to match `__builtin_predict`. The patch is based on Bruno's suggestions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88363

Files:
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGenCXX/attr-likelihood-if-vs-builtin-expect.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88363.294509.patch
Type: text/x-patch
Size: 14742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200926/8f728319/attachment-0001.bin>


More information about the cfe-commits mailing list