This is an archive of the discontinued LLVM Phabricator instance.

[CFLAA] Code cleanup: remove redundant node-to-value mapping and value-to-node mapping
ClosedPublic

Authored by grievejia on Jun 10 2016, 11:26 AM.

Details

Summary

This patch introduces no functional changes.

It merely specialize WeightedBidirectionalGraph (rename it to CFLGraph) to fix its node type to be Value*. Such specialization help us get rid of the two redundant DenseMaps, one maps from Value* to integer and the other one maps from integer to Value*.

Diff Detail

Event Timeline

grievejia updated this revision to Diff 60377.Jun 10 2016, 11:26 AM
grievejia retitled this revision from to [CFLAA] Code cleanup: remove redundant node-to-value mapping and value-to-node mapping.
grievejia updated this object.
grievejia added a subscriber: llvm-commits.

Woohoo for deleting code! Two comments for you.

lib/Analysis/CFLAliasAnalysis.cpp
547

Nit: no else

570

This looks like it can make FromEdges a dangling reference if we resize the map while adding To :)

grievejia marked 2 inline comments as done.Jun 11 2016, 12:14 PM
grievejia added inline comments.
lib/Analysis/CFLAliasAnalysis.cpp
570

This is subtle! Thanks for catching it.

grievejia updated this revision to Diff 60441.Jun 11 2016, 12:16 PM
grievejia edited edge metadata.
grievejia marked an inline comment as done.

Nits fixed

george.burgess.iv edited edge metadata.

LGTM, thanks.

This revision is now accepted and ready to land.Jun 13 2016, 12:24 PM
This revision was automatically updated to reflect the committed changes.