This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Do not call computeKnownBits from isKnownToBeAPowerOfTwo
ClosedPublic

Authored by foad on Apr 27 2023, 1:36 AM.

Details

Summary

The only way known bits could help identify a known power of two is if
it knows exactly which power of two it is, i.e. if it is a known
constant. But in that case the value should have been simplified to a
constant already. So save some compile time by not calling
computeKnownBits.

Diff Detail

Unit TestsFailed

Event Timeline

foad created this revision.Apr 27 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 1:36 AM
foad requested review of this revision.Apr 27 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 1:36 AM
RKSimon accepted this revision.Apr 27 2023, 2:47 AM

LGTM - IIRC the plan was to add DemandedElts support which would have made better use of this but it has never ended up being necessary

This revision is now accepted and ready to land.Apr 27 2023, 2:47 AM
This revision was landed with ongoing or failed builds.Apr 27 2023, 3:06 AM
This revision was automatically updated to reflect the committed changes.