[PATCH] D46760: [InstCombine] Enhance narrowUDivURem.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 07:00:43 PDT 2019


spatel added a comment.

In D46760#1555425 <https://reviews.llvm.org/D46760#1555425>, @spatel wrote:

> In D46760#1553974 <https://reviews.llvm.org/D46760#1553974>, @lebedev.ri wrote:
>
> > @spatel where we're at with funnel-shift canonicalization with constant shift amounts?
> >  Is it time to fix this via fixing https://bugs.llvm.org/show_bug.cgi?id=37872 ?
>
>
> Yes, I can make that change. I'm not aware of any gaps in IR analysis for funnel-shift / rotate at this point, and the expansion in SDAG should be identical to the current IR sequence:
>
>   or (shl X, C), (lshr X, (width - C))


A 1st hack at this shows that we do have missing canonicalizations: we don't turn funnel-shift into bswap when possible (thought we had a bug on that 1, but I don't see it now), and we don't recognize bswap sequences that contain intermediate bswaps. Regression tests in test/Transforms/InstCombine/bswap.ll are affected.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D46760/new/

https://reviews.llvm.org/D46760





More information about the llvm-commits mailing list