[PATCH] D33342: [InstCombine] try to canonicalize xor-of-icmps to and-of-icmps

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 13:58:21 PDT 2017


spatel added a comment.

In https://reviews.llvm.org/D33342#784553, @efriedma wrote:

> Sorry about the delayed review.


No problem - thanks for all of your help reviewing my patches!

> The particular case I cited works... I didn't really think it through.
> 
> This still seems like an expensive way to handle these transforms, but I guess that's unlikely to matter in practice.

Yep - I can't imagine there's a whole lot of xor'ing of icmps out there, but since this showed up in a bug report, we know there's at least some in existence. I think the alternative would be to add specific matchers for the patterns seen here. In the end, I think that would either be more expensive (because we'd have to duplicate lots of the matcher code that exists for and/or) or have incomplete optimization powers vs. what we do for the other logic ops.


https://reviews.llvm.org/D33342





More information about the llvm-commits mailing list