This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] rename/move isKnownToBeAPowerOfTwo() from TargetLowering
ClosedPublic

Authored by spatel on May 19 2016, 8:47 AM.

Details

Summary

In D19087, we found that the logical equivalent of isKnownToBeAPowerOfTwo() was hiding in TargetLowering as a static function named valueHasExactlyOneBitSet().

This is a no-functional-change-intended patch to rename/move that function over to SelectionDAG near its related analysis functions.

There are at least 2 places (DAGCombiner, X86ISelLowering) where this could be used instead of ad-hoc and watered down code that is trying to match a power-of-2 pattern.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 57803.May 19 2016, 8:47 AM
spatel retitled this revision from to [SelectionDAG] rename/move isKnownToBeAPowerOfTwo() from TargetLowering.
spatel updated this object.
spatel added reviewers: kbsmith1, hfinkel, qcolombet.
spatel added a subscriber: llvm-commits.
hfinkel accepted this revision.May 19 2016, 8:51 AM
hfinkel edited edge metadata.

LGTM.

This revision is now accepted and ready to land.May 19 2016, 8:51 AM
This revision was automatically updated to reflect the committed changes.