This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Teach GetDemandedBits to look at the known zeros of the LHS when handling ISD::AND
ClosedPublic

Authored by craig.topper on Feb 20 2019, 11:05 AM.

Details

Summary

If the LHS has known zeros, then the RHS immediate mask might have been simplified to remove those bits.

This patch adds a call to computeKnownBits to get the known zeroes to handle that possibility. I left an early out to skip the call if all of the demanded bits are set in the mask.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 20 2019, 11:05 AM
This revision is now accepted and ready to land.Feb 20 2019, 12:21 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2019, 12:52 PM