This is an archive of the discontinued LLVM Phabricator instance.

Templatize parts of VNCoercion, and add constant-only versions of the functions to be used in NewGVN. NFCI.
ClosedPublic

Authored by dberlin on Mar 13 2017, 9:58 PM.

Details

Summary

This is ground work for the changes to enable coercion in NewGVN.
GVN doesn't care if they end up constant because it eliminates as it goes.
NewGVN cares.

IRBuilder and ConstantFolder deliberately present the same interface,
so we use this to our advantage to templatize our functions to make
them either constant only or not.

Event Timeline

dberlin created this revision.Mar 13 2017, 9:58 PM
  • Coercion to load type and get stored value got split, update getLoadValueForLoad to reflect

Updating D30928: Templatize parts of VNCoercion, and add constant-only versions of the functions to be used in NewGVN.

NFCI.

Rework code a little from to remove need for getLoadValueFromLoadHelper

Updating D30928: Templatize parts of VNCoercion, and add constant-only versions of the functions to be used in NewGVN.

NFCI.

dberlin added inline comments.Mar 14 2017, 12:02 AM
lib/Transforms/Utils/VNCoercion.cpp
412

This is unused (load-load coercion is not implemented in the dependent patch), but still obviously wrong, i'll fix in a minute.

Update for boostrapped and 3-staged version

Updating D30928: Templatize parts of VNCoercion, and add constant-only versions of the functions to be used in NewGVN.

NFCI.

davide accepted this revision.Mar 17 2017, 2:33 PM

LGTM, thanks.

This revision is now accepted and ready to land.Mar 17 2017, 2:33 PM

I actually reviewed/LGTM'ed this one days ago but phab didn't send the message. Oh, well.

This revision was automatically updated to reflect the committed changes.