[PATCH] D45173: [InstCombine] Recognize idioms for ctpop and ctlz

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 09:31:08 PDT 2018


kparzysz added a comment.

In https://reviews.llvm.org/D45173#1057742, @efriedma wrote:

> As you've noted, running "instcombine" before your pattern-recognition code is going to be a constant source of trouble, because it isn't a fixed set of transforms, and it runs very early in the pass pipeline.  So either you run your pattern-recognition before instcombine, or you add some tests to the LLVM regression tests which will break if a new transform breaks your pattern-recognition, and hope for the best.  I guess it might help a bit if we came up with some restricted criteria for allowed transforms in instcombine, and put the rest into aggressive-instcombine.  But we're never going to completely freeze the optimization pipeline, so there's fundamentally some maintenance burden.


The problem right now is that with both, instcombine and complex pattern matching, ongoing development of instcombine will incur very high maintenance costs on the pattern matching code.  This is what I'd like to avoid.  I'd like to have both optimizations, but without the interference.  Running pattern recognition first sounds like the least invasive change and would hopefully keep everybody happy.


Repository:
  rL LLVM

https://reviews.llvm.org/D45173





More information about the llvm-commits mailing list