[llvm] r255334 - [InstCombine] Make MatchBSwap also match bit reversals

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 24 13:31:49 PST 2015


On Fri, Dec 11, 2015 at 10:04:51AM -0000, James Molloy via llvm-commits wrote:
> Author: jamesm
> Date: Fri Dec 11 04:04:51 2015
> New Revision: 255334
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=255334&view=rev
> Log:
> [InstCombine] Make MatchBSwap also match bit reversals

While I like the idea here, the implementation is not reasonable.

Consider the following input:

unsigned b;
fn1() {
  int i;
  for (i = 0; i < LIMIT; ++i)
    b |= b >> 1;
}

Debug+assert builds start to show the exponential runtime for LIMIT
around 10, release builds after 18 or so. Intercal effectively used 32
and hit the CPU fans :)

Joerg


More information about the llvm-commits mailing list