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

Authored by dberlin on Mon, Mar 13, 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.

Diff Detail

Repository
rL LLVM
dberlin created this revision.Mon, Mar 13, 9:58 PM
dberlin updated this revision to Diff 91678.Mon, Mar 13, 10:41 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.

dberlin updated this revision to Diff 91679.Mon, Mar 13, 10:51 PM

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.Tue, Mar 14, 12:02 AM
lib/Transforms/Utils/VNCoercion.cpp
404 ↗(On Diff #91679)

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

dberlin updated this revision to Diff 91680.Tue, Mar 14, 1:24 AM

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.Fri, Mar 17, 2:33 PM

LGTM, thanks.

This revision is now accepted and ready to land.Fri, Mar 17, 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.