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

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 09:04:07 PDT 2018


kparzysz added a comment.

In https://reviews.llvm.org/D45173#1056890, @spatel wrote:

> I don't know if there's an actual strategy. There's no formal definition of 'canonical IR' AFAIK, so we continue to simplify code via peepholes in instcombine. Anything downstream of that has to adjust to those changes. I've dealt with that many times as an interaction between instcombine and DAG combine.


This isn't sustainable in the long run.  Recognizing complex computations and replacing them with short equivalents (such as intrinsics that targets may provide efficient implementations of) is arguably better than only doing peephole optimizations, and yet the current model makes it really difficult to write such code.


Repository:
  rL LLVM

https://reviews.llvm.org/D45173





More information about the llvm-commits mailing list