[PATCH][instcombine] Remove preservesCFG from instcombine

Chandler Carruth chandlerc at google.com
Tue Nov 4 12:15:24 PST 2014


On Tue, Nov 4, 2014 at 2:03 PM, Mark Heffernan <meheff at google.com> wrote:

> It seems to me that LoopSimplify is the problem here.


Yes.


>  Should LoopSimplifyPass be marked as IsCFGOnlyPass?  It clearly modifies
> the CFG.  From the "writing an llvm pass" manual:  "if a pass walks CFG
> without modifying it then the third argument [isCFGOnly] is set to true",
> however, I don't know how definitive that is and the logic of that
> statement doesn't exactly imply that a CFG-modifying pass can't be marked
> isCFGOnly.  If LoopSimplifyPass is changed to !isCFGOnly, then preservesCFG
> can be added back to instcombine (at least for the purposes of the bug I
> ran into).


This seems like the correct fix to me. I strongly disagree with the
original approach (although I understand how you got there).

There is absolutely no reason why preserving the CFG should be equivalent
to preserving LoopSimplify.

In fact, preserving LoopSimplify never *really* makes sense because it is a
transformation pass, not an analysis pass. But in the current pass manager
we have no effective alternative. =[
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141104/0b0b835a/attachment.html>


More information about the llvm-commits mailing list