[PATCH] D33572: [PPC] Implement fast bit reverse in PPCDAGToDAGISel

Carrot Wei via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 14:56:33 PDT 2017


This actually fixes a target-specific problem.

In pr33093, a fast reverse bits algorithm is given in source code, but
PPCDAGToDAGISel::tryBitPermutation tracks down where each bit comes
from, and construct a new code sequence to move bits. Unfortunately it
doesn't recognize the reverse bits pattern and generates slow bit by
bit moves.
This patch identifies the reverse bits pattern and reconstruct the
fast code sequence.

A target independent IR level bit reverse optimization may also
benefit other targets, but it should be another patch.

On Fri, May 26, 2017 at 2:43 PM, Joerg Sonnenberger <joerg at bec.de> wrote:
> On Thu, May 25, 2017 at 10:36:38PM +0000, Guozhi Wei via Phabricator via llvm-commits wrote:
>> Current PPCDAGToDAGISel doesn't handle bit reverse efficiently,
>> it generates bit by bit moves for it, even if we give it the following fast algorithm.
>
> This shouldn't really be target-specific code, should it be?
>
> Joerg


More information about the llvm-commits mailing list