This change makes it possible to optionally provide a different callback to
determine if an instruction is materializable.
By default the behaviour is unchanged.
| Paths 
 |  Differential  D142621  
[Couroutines] Modify CoroFrame materializable into a callback ClosedPublic Authored by dstuttard on Jan 26 2023, 5:42 AM. 
Details Summary This change makes it possible to optionally provide a different callback to By default the behaviour is unchanged. 
Diff Detail 
 Event TimelineThis revision is now accepted and ready to land.Jan 27 2023, 10:41 AM Comment Actions LGTM, one minor inline comment. 
 Comment Actions While this is innocent and no harmful, I prefer to land this after we found a usage for this someday. It wouldn't be a problem to do such a NFC change any times. This revision now requires review to proceed.Feb 8 2023, 6:02 PM Comment Actions 
 We have a use-case for this change for one of our backends. Comment Actions 
 To expand on this - we have a tool based on LLVM that already adds extra materialization options. This change was to enable generic support to extend materialization determination so that we can simplify our code  to not have patches on top of upstream llvm. Comment Actions 
 Got it. But it is still not good to modify the upstream due the requirement from the downstream. (I know this happens in llvm occasionally. But it is still not good, right?) I think it may better for you to contribute the other materialization options you mentioned. Or you can try to add a unittest if you don't want to contribute the downstream extension to public for any reason . Otherwise, even all people here get in consensus. It is possible that other developers found the coding here is redundant and optimize it with a NFC patch directly. (This happens a lot in llvm) Comment Actions 
 Ok - I added a unit test for this - adding the other rematerializations isn't an option since they are quite project specific. (To be fair, I should probably have created a unit test in the first place). Comment Actions Thanks for the unit test! 
 
 This revision is now accepted and ready to land.Feb 10 2023, 9:00 PM This revision was landed with ongoing or failed builds.Feb 13 2023, 3:07 AM Closed by commit rGc4f7cc867299: [Coroutines] Modify CoroFrame materializable into a callback (authored by dstuttard).  ·  Explain Why This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
 
Diff 495214 llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
 llvm/lib/Transforms/Coroutines/CoroFrame.cpp
 llvm/lib/Transforms/Coroutines/CoroInternal.h
 llvm/lib/Transforms/Coroutines/CoroSplit.cpp
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Maybe pass the callback by reference, both here and for the following calls?
An std::function is quite large (32 bytes for libstdc++, 40 for MSVC, 48 for libc++).