[PATCH] [SCEV] Make isImpliedCond smarter.

Sanjoy Das sanjoy at playingwithpointers.com
Mon Mar 16 11:31:09 PDT 2015


On Mon, Mar 16, 2015 at 9:26 AM, Andrew Trick <atrick at apple.com> wrote:
> Hi Sanjoy,
>
> This looks ok, but is there any way to canonicalize (add-by-constant <pred> constant) before checking isImpliedCond? That way it would be symmetric and you wouldn't need separate logic to handle it.

Do you mean canonicalize, e.g., "(X - 1) sgt -1" to "X sgt 0"?  I
don't think we can do that -- the latter only implies the former, but
the two conditions are not equivalent -- X could be INT_MIN.  We could
do this canonicalization if X-1 was nsw, but that's a separate change.
This change is specifically supposed to work without any knowledge of
no-wrap bits.

-- Sanjoy

>
>
> http://reviews.llvm.org/D8346
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>



More information about the llvm-commits mailing list