This is an archive of the discontinued LLVM Phabricator instance.

SelectionDAG: Add AssertAnd SDNode
AbandonedPublic

Authored by tstellarAMD on Jul 15 2015, 10:20 AM.

Details

Summary

The AssertAnd node is modeled after the Assert[SZ]ext nodes and is
used to represent values that are known to have some bits equal to
zero.

The purpose of this new SDNode is to allow targets to improve the
accuracy of the computeKnownBits computation in cases where values are
known to use less bits than their types size. For example, on targets
where pointers do not use all the available bits: e.g. pointer size is
64-bit, but only 48 bits are actually used.

Diff Detail

Event Timeline

tstellarAMD retitled this revision from to SelectionDAG: Add AssertAnd SDNode.
tstellarAMD updated this object.
tstellarAMD added reviewers: arsenm, resistor, escha.
tstellarAMD added a subscriber: llvm-commits.
escha edited edge metadata.Jul 15 2015, 10:26 AM

If I'm understanding right, this is distinct from (for example) the concept behind the code in AARCH64 that calls simplifyDemandedBits on addresses used by loads/stores to optimize given knowledge of 56-bit addresses? That is, this node represents "the high bits must be zero", not "the high bits are ignored by the addressing operations" (also, is there some reason this can't use AssertZext -- is it because AssertZext can't take an i48?)

tstellarAMD abandoned this revision.Jul 15 2015, 1:52 PM

I can achieve the same result using AssertZext.. Using AssertAnd is useful if you want to apply a mask for alignment, but I don't need that functionality at the moment.