HomePhabricator

[InstCombine] Add CTPOP -> CTTZ simplifications (PR43513)

Authored by RKSimon on Mar 23 2020, 3:50 AM.

Description

[InstCombine] Add CTPOP -> CTTZ simplifications (PR43513)

As detailed on PR43513, we can simplify:

ctpop(x | -x) -> bitwidth - cttz(x, false)
Alive2: http://volta.cs.utah.edu:8080/z/caw49X

ctpop(~x & (x - 1)) -> cttz(x, false)
Alive2: http://volta.cs.utah.edu:8080/z/5zfVrx

I've tweaked the initial test cases I added at rG2d712fb75584 to increase commutativity testing.

Differential Revision: https://reviews.llvm.org/D76568

Details

Committed
RKSimonMar 23 2020, 4:04 AM
Differential Revision
D76568: [InstCombine] Add CTPOP -> CTTZ simplifications (PR43513)
Parents
rG6081ccf4a3b6: Apply function attributes through array declarators
Branches
Unknown
Tags
Unknown