[llvm-commits] More aggressive speculation in SimplifyCFG

Andrew Trick atrick at apple.com
Fri Jan 25 14:19:15 PST 2013


On Jan 25, 2013, at 1:39 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote:

> On 1/25/2013 3:25 PM, Andrew Trick wrote:
>> 
>> If you disagree [...].
> 
> No, I do not disagree at all.  Actually, I would prefer it that way myself.  The _only_ reason I put it in SimplifyCFG is because there was already code in there that did the exact same thing (except with more restrictions).  I like the idea of c14n[1] of the CFG and I don't think that it should be limited in its reach to only the early stages of IR processing.
> 
> Anyways, if the agreement is to factor the speculating code out into a separate pass, I can do that.  In doing so, I will remove the current speculation from the existing SimplifyCFG.

I'm ok with your patch if it is implemented in a separate .cpp file and runs in a new pass. I suggest enabling it only on your target using one of the pass config hooks, such as TargetPassConfig::addISelPrepare. I think your pass is useful for experimentation on other targets, but we would prefer those targets to use EarlyIfConverter if possible.

If you change the current behavior of SimplifyCFG, that should be in a separate patch. Although feel free to factor the code. We have to be careful preserve instcombine's expectation that certain idioms will be converted to selects.

-Andy



More information about the llvm-commits mailing list