This is an archive of the discontinued LLVM Phabricator instance.

Use the new 'InvariantInfo' property to eliminate redundant loads with --gvn.
Needs ReviewPublic

Authored by lvoufo on Oct 22 2015, 9:08 PM.

Details

Summary

While processing instructions in GVN, mark global variables and alloca instructions corresponding to each encountered invariant intrinsic call as indicating 'writeonce' memory locations that either have been written into or can be written into again (once). Then, while scanning instructions backwards looking for pointer dependencies for a given load instruction, be sure to temporarily disable or reset the markings, as appropriate.

This patch is a break-down of (corrected) D13606.

Diff Detail

Event Timeline

lvoufo updated this revision to Diff 38204.Oct 22 2015, 9:08 PM
lvoufo retitled this revision from to Use the new 'InvariantInfo' property to eliminate redundant loads with --gvn..
lvoufo updated this object.
lvoufo added reviewers: dberlin, nlewycky, reames.
lvoufo added a subscriber: llvm-commits.
sanjoy added a subscriber: sanjoy.Oct 22 2015, 9:48 PM

Please add some tests.

Please add some tests.

See D14006. This is a split-up of a larger patch to help readability.

nlewycky edited edge metadata.Nov 8 2015, 4:13 PM

This adds a call to "processInvariantIntrinsic" in GVN.cpp, but there is no such function and it isn't defined in this patch?

lvoufo added a comment.Nov 8 2015, 9:03 PM

This adds a call to "processInvariantIntrinsic" in GVN.cpp, but there is no such function and it isn't defined in this patch?

processInvariantIntrinsic is defined in D14003, which this patch depends on. Does this help?

reames resigned from this revision.Apr 18 2016, 4:56 PM
reames removed a reviewer: reames.