[PATCH] D45731: [InstCombine] Adjusting bswap pattern matching to hold for And/Shift mixed case

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 09:09:22 PDT 2018


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D45731#1081031, @opaparo wrote:

> In https://reviews.llvm.org/D45731#1070485, @spatel wrote:
>
> > Thanks for coming back to this. I think this patch is fine as one more match of a potential IR variant, but...
> >  Since the time we started the discussion in https://reviews.llvm.org/D41353, there was a proposal to improve matching for ctpop and ctlz in https://reviews.llvm.org/D45173. I'm curious what others think about the fact that we match bswap/bitreverse in regular instcombine. Would it be better to match all of those intrinsics in the same place? Do we distinguish these based on how often we expect them to occur?
>
>
> Ping.
>  Is there a decision regarding this matter?


I haven't seen anything. For reference, I mentioned ctpop/ctlz in the context of https://reviews.llvm.org/D45986 too, so I think we should do something to organize these optimizations, but I'm not sure what's best.
That said, I think this patch is fine as an enhancement of the existing code, so LGTM.


Repository:
  rL LLVM

https://reviews.llvm.org/D45731





More information about the llvm-commits mailing list