[PATCH] D19087: [x86, ppc] prefer comparisons against zero for and+cmp sequences

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 07:28:27 PDT 2016


spatel added a comment.

In http://reviews.llvm.org/D19087#400599, @hfinkel wrote:

> This certainly a good pattern to catch, but I'm not sure that CGP is the right place for this. We generally have things in CGP to work-around the fact that SDAG/ISel is basic-block local. This kind of thing seems much more natural as a something that should be in DAGCombine.


Yes, I initially thought I'd do this as a DAGCombine, but then I realized that we'd need "isKnownToBeAPowerOfTwo()", and I don't see an SDNode equivalent for the IR version. I'm not sure where we draw the line between CGP and DAGCombine, but duplicating isKnownToBeAPowerOfTwo() scared me away.


http://reviews.llvm.org/D19087





More information about the llvm-commits mailing list