[PATCH] D77868: [InstSimplify] fold select of bools using bitwise logic

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 11:20:33 PDT 2020


spatel added a comment.

In D77868#1978197 <https://reviews.llvm.org/D77868#1978197>, @nikic wrote:

> I think I have an actual example of a miscompile now: http://volta.cs.utah.edu:8080/z/VBAN4q
>
> This fold does exist in InstSimplify: https://godbolt.org/z/7n3oQ8


Thanks! That looks indisputable. I'll add that test to prevent tripping again. I almost had the variation with 'fcmp uno' in the tests here, but didn't imagine the pattern with non-constant extra operand.

So the problem in my sequence of simplifications is at step #4. We do not have to prove that Cond is true or the same as T independently of T itself. The bitwise logic relationship may simplify via implication.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77868/new/

https://reviews.llvm.org/D77868





More information about the llvm-commits mailing list