[PATCH] D51398: [InstCombine] Fold (min/max ~X, Y) -> ~(max/min X, ~Y) when Y is freely invertible

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 30 12:14:36 PDT 2018


craig.topper added a comment.

@davidxl, this transform doesn't really know if its changing the compare predicate because the min/max matching considers (select (icmp slt X, ~C), ~X, C) to be equivalent to (select (icmp sgt ~X, C), ~X, C). And it only returns the select operands to the calling code. So this transform rewrites the icmp, but doesn't know which form the original compare took.


https://reviews.llvm.org/D51398





More information about the llvm-commits mailing list