[PATCH] D40728: [CallSiteSplitting] Refactor creating callsites.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 07:33:58 PST 2017


fhahn created this revision.

This change makes the call site creation more general if any of the
arguments is predicated on a condition in the call site's predecessors.

If we find a callsite, that potentially can be split, we collect the set
of conditions for the call site's predecessors (currently only 2
predecessors are allowed). To do that, we traverse each predecessor's
predecessors as long as it only has single predecessors and record the
condition, if it is relevant to the call site. For each condition, we
also check if the condition is taken or not. In case it is not taken,
we record the inverse predicate.

We use the recorded conditions to create the new call sites and split
the basic block.

This has 2 benefits: (1) it is slightly easier to see what is going on
(IMO) and (2) we can easily extend it to handle more complex control
flow.


https://reviews.llvm.org/D40728

Files:
  lib/Transforms/Scalar/CallSiteSplitting.cpp
  test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40728.125141.patch
Type: text/x-patch
Size: 10722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171201/6160a912/attachment.bin>


More information about the llvm-commits mailing list