[PATCH] D47949: [callsitesplit] Limit the # of predecessors walk when recording condition

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 14:50:41 PDT 2018


fhahn added a comment.

In https://reviews.llvm.org/D47949#1130490, @trentxintong wrote:

> @davide @fhahn I am sorry that I cant provide the source code. But one of the cases that resulted in chasing up the chain a lot I can see came from a sequence of object declarations & initializations (constructors which can throw). And they cascaded into a block with 2 predecessors.


There is no need for (C/C++) source code. A simple LLVM IR test case in test/Transforms/CallSiteSplitting/ would be good.

> Actually in this case we did not manage to find anything interesting to arguments, i.e. the terminator is an InvokeInst.
> 
> Before we fix the pass, do you think its reasonable to land this patch (with test cases provided) and a FIXME on the knob about this discussion/review so that we can remove it after the fundamental problem with the pass is addressed to help us and also possibly other people with similar situations.

So I had a look at using PredicateInfo for this. It does something very similar, but unfortunately I don't think we can just use it, as it only inserts copies in code paths dominated by the condition, whereas for callsitesplitting, the callsite is usually not dominated by the conditions. Only the predecessors we create when splitting are. However we should be able to use a similar approach to just traverse the CFG once.

I can look into that over the next few weeks. I am not sure if it is worth putting the fix in until then, but it could be valuable as a temporary fix for some cases.


Repository:
  rL LLVM

https://reviews.llvm.org/D47949





More information about the llvm-commits mailing list