HomePhabricator

[ValueTracking] add range limits for ctlz

Authored by spatel on Oct 23 2020, 5:29 AM.

Description

[ValueTracking] add range limits for ctlz

As discussed in D89952,
instcombine can sometimes find a way to reduce similar patterns,
but it is incomplete.
InstSimplify uses the computeConstantRange() ValueTracking analysis
via simplifyICmpWithConstant(), so we just need to fill in the max
value of ctlz to process any "icmp pred ctlz(X), C" pattern (the
min value is initialized to zero automatically).

Follow-up to D89976.

Details

Committed
spatelOct 23 2020, 5:43 AM
Parents
rG0351bd959fae: [InstSimplify] add tests for cttz constant range; NFC
Branches
Unknown
Tags
Unknown