This is an archive of the discontinued LLVM Phabricator instance.

Add attributes to the inlined operations
Needs RevisionPublic

Authored by liufengdb on Nov 23 2020, 10:17 PM.

Details

Summary

When the operations in the source region are inlined, a list of
attributes can be added to these operations.

Diff Detail

Event Timeline

liufengdb created this revision.Nov 23 2020, 10:17 PM
liufengdb requested review of this revision.Nov 23 2020, 10:17 PM

removed the unused file

rriddle requested changes to this revision.Nov 23 2020, 10:21 PM

I'm not really understanding the motivation here. What is the intended use case for this? And why couldn't this be done by the caller instead?

This revision now requires changes to proceed.Nov 23 2020, 10:21 PM

This is to propagate the attributes, such as "device" and "_tpu_replicate", to the inlined operations. These attributes might be different at different call sites, so we couldn't set them in the src.
An alternative implementation is the inlineCall method returns all the new inlined operations, so the caller can set them.

An alternative implementation is the inlineCall method returns all the new inlined operations, so the caller can set them.

I think providing more control to the caller would enable finer-grain decision, I'm more in favor of going this route.

I created a separate patch https://reviews.llvm.org/D92116. Can you take a look?