[PATCH] Do not transform PHI to select if doing so would be unsafe
Rafael Ávila De Espíndola
rafael.espindola at gmail.com
Mon Jun 3 10:59:36 PDT 2013
>>
>> Why do you need the isa<ConstantExpr>? Can't the check be just
>>
>> if (!isSafeToSpeculativelyExecute(BB1V) ||
>> !isSafeToSpeculativelyExecute(BB2V))
>> return Changed;
>
> The reason why is for performance and correctness. I don't want to look at every instruction that can be fed into an incoming value for a phi. I just want to see the ones that can be executed *before* the phi node in the same BB as the phi. Which are these? ConstantExprs. FWIW, another part of SimplifyCFG operates in the exact same way.
>
Got it. Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130603/39fa4896/attachment.html>
More information about the llvm-commits
mailing list