[PATCH] D33164: [Profile[ Enhance expect lowering to handle correlated branches

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 13 11:59:35 PDT 2017


davidxl created this revision.

There are situations buitlin_expect is used on a set of conditions (&&, ||) where there is only one expect builtin call inserted.  There is also situations where the result of builtin_expect is not fed into any branches (e.g, a ternary expression).  In the above cases, the lowering phase fails to annotate the all related branches.

This patch enhances the lowering phase by doing 'backward' analysis with Phidefs. For examples, see the test cases.


https://reviews.llvm.org/D33164

Files:
  lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
  test/Transforms/LowerExpectIntrinsic/phi_merge.ll
  test/Transforms/LowerExpectIntrinsic/phi_or.ll
  test/Transforms/LowerExpectIntrinsic/phi_tern.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33164.98899.patch
Type: text/x-patch
Size: 15565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170513/07010531/attachment.bin>


More information about the llvm-commits mailing list