This is an archive of the discontinued LLVM Phabricator instance.

[MemorySSA] Tighten up API type signatures. NFC.
ClosedPublic

Authored by bryant on Oct 30 2016, 2:34 AM.

Details

Summary

From what I understand, MSSA nodes are either MemoryPhis (which must only be associated with BasicBlocks), or MemoryUseOrDef (which must only be associated Instructions). Assuming that this invariant would not change in the future (which could easily not be the case if, for instance, there is desire for additional MSSA node types):

  1. getMemoryAccess could only ever return meaningful values when give a BasicBlock or Instruction,
  2. createMemoryAccessBefore/After could only ever return nodes for Instructions,
  3. Insertion of a new MemoryUseOrDef could only occur before another MemoryUseOrDef, since MemoryPhis must always come first in a BB's AccessList.

These type changes also have the pleasant side effect of reducing pointer casting verbiage.

Diff Detail

Repository
rL LLVM

Event Timeline

bryant updated this revision to Diff 76329.Oct 30 2016, 2:34 AM
bryant retitled this revision from to [MemorySSA] Tighten up API type signatures..
bryant updated this object.
bryant set the repository for this revision to rL LLVM.
bryant added a subscriber: llvm-commits.
bryant retitled this revision from [MemorySSA] Tighten up API type signatures. to [MemorySSA] Tighten up API type signatures. NFC..Oct 30 2016, 3:08 AM
dberlin accepted this revision.Oct 31 2016, 7:15 AM
dberlin edited edge metadata.
This revision is now accepted and ready to land.Oct 31 2016, 7:15 AM
This revision was automatically updated to reflect the committed changes.