This is an archive of the discontinued LLVM Phabricator instance.

Enable IPConstantPropagation to work with abstract call sites
ClosedPublic

Authored by jdoerfert on Jan 8 2019, 10:29 AM.

Details

Summary

This modification of the currently unused inter-procedural constant
propagation pass (IPConstantPropagation) shows how abstract call sites
enable optimization of callback calls alongside direct and indirect
calls. Through minimal changes, mostly dealing with the partial mapping
of callbacks, inter-procedural constant propagation was enabled for
callbacks, e.g., OpenMP runtime calls or pthreads_create.

Diff Detail

Event Timeline

jdoerfert created this revision.Jan 8 2019, 10:29 AM
jdoerfert updated this revision to Diff 180695.Jan 8 2019, 10:31 AM

Update the old encoding

jdoerfert updated this revision to Diff 180708.Jan 8 2019, 11:39 AM

Rebase to HEAD

reames added inline comments.Jan 14 2019, 8:08 PM
lib/Transforms/IPO/IPConstantPropagation.cpp
65–67

"is invalid" probably isn't quite the right wording.

Maybe: If we don't understand the use, bail?

83

Can you explain this bit? I don't understand the intention from the context. Why would it be legal to constant fold a thread dependent constant through a direct callee, but not an indirect callback callee?

jdoerfert updated this revision to Diff 181712.Jan 14 2019, 8:36 PM
jdoerfert marked an inline comment as done.

Improved the documentation

jdoerfert updated this revision to Diff 181714.Jan 14 2019, 8:39 PM

Fix wording

jdoerfert marked 2 inline comments as done.Jan 14 2019, 8:40 PM

Does the new documentation make sense?

reames accepted this revision.Jan 15 2019, 10:13 AM

LGTM w/one required follow up: the fact that callbacks don't have to execute on the same thread was not obvious from the LangRef wording approved. Please tweak wording to spell that out explicitly.

This revision is now accepted and ready to land.Jan 15 2019, 10:13 AM
This revision was automatically updated to reflect the committed changes.