[PATCH][instcombine] Remove preservesCFG from instcombine
Mark Heffernan
meheff at google.com
Tue Nov 4 12:22:41 PST 2014
On Tue, Nov 4, 2014 at 12:15 PM, Chandler Carruth <chandlerc at google.com>
wrote:
>
> 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).
>
Yep. Slowly figuring things out here :-)
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. =[
>
If only someone was working on a new pass manager... ;-)
If no one has any objections, I'll make the change restoring setpreservecfg
to instcombine and changing loopsimplify to !isCfgOnly.
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141104/ba755701/attachment.html>
More information about the llvm-commits
mailing list