[PATCH] SimplifyCFG: turn recursive GatherConstantCompares into iterative

Chandler Carruth chandlerc at google.com
Mon Nov 17 12:51:30 PST 2014


On Mon, Nov 17, 2014 at 2:01 PM, Chad Rosier <mcrosier at codeaurora.org>
wrote:

> > As a side question, the existing code assumes that the "icmp" are always
> > taking the constant as the second operand (it never tries to match the
> > first operand). Is it something that is canonicalized in the IR and can
> be
> > assumed here?
>
> AFAIK, it's the preferred form in IR and I've seen a lot of code that make
> this assumption.  However, you should investigate on a case by case basis.
>  I'm not aware of any pass or verifier that strictly enforces this
> standard across all optimizations/passes.


I'm moderately certain that instcombine canonicalizes constants to the RHS
of an icmp.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141117/49417198/attachment.html>


More information about the llvm-commits mailing list