[PATCH] D29774: [InstCombine] fold icmp sgt/slt (add nsw X, C2), C --> icmp sgt/slt X, (C - C2)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 12 07:59:41 PST 2017


spatel added a comment.

In https://reviews.llvm.org/D29774#674493, @nlopes wrote:

> LGTM.
>  The easy way to check for overflow in Alive: http://rise4fun.com/Alive/MH


Thanks! I should read some docs now. :)
It looks like I should start with the papers and presentations from previous LLVM dev confs...is there also a reference doc for the online tool?

> Regarding the instsimplify ones you mention, I didn't check what's implemented, but they need a precondition stronger than just that C1-C2 overflows: http://rise4fun.com/Alive/TRL

We know that those will simplify to true/false in all cases, but we don't know if the result is true or false unless we check the sign of C2:
http://rise4fun.com/Alive/2S


https://reviews.llvm.org/D29774





More information about the llvm-commits mailing list