-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design multiple approaches to attach information to CFG or Values #5
Comments
From meeting 14.03.2017: @michkot suggests something like Type->instance of Type info dictionary. // sample code for non-sharing annotations
info.Get<MySpecialCfgAttribute>();
info.Set<MySpecialCfgAttribute>(uptr<MySpecialCfgAttribute>&& element); //ptr constructor
info.Set<MySpecialCfgAttribute>(args&&..); //emplace constructor
info.Set<MySpecialCfgAttribute>(MySpecialCfgAttribute&&) //move constructor
// sample for sharing annotations
info.SetShared<MySpecialCfgAttribute>(const MySpecialCfgAttribute&) //store ref/ptr
// both could be mixed if needed (there is an endless amount of ways how to implement this) @peringer suggests mapping custom keys to 0-based indexes, and then using those indexes under the hood. Annotation storage could be small_vector<uptr>
@tfiedor also suggested something similar to those ideas, but i forgot what it was... Notes:
I believe this is a critical feature of Angie framework and I would like to make it right and call for a wider discussion here or at slack. |
maybe we can use the access method: AttrBasePtr p = node.annotation(indexEnum4myAppendix); |
@peringer I am not sure if understand the access method. Could you give a longer example?
|
I created proof of concept code - see sarka:/home/local/0-angie/angie-test2.cc |
I've created a gist (github snippet) with the code: |
Design several possible ways how to attach information to instructions or values.
Present motivation for this is dead/live variable analysis - results of such an analysis could be precomputed and assigned either to CfgNodes (instructions) or to FrontendIds (values / SSA registers).
Info sources:
https://github.com/kdudka/predator/blob/master/cl/killer.cc
http://llvm.org/docs/doxygen/html/LiveVariables_8h_source.html
http://llvm.org/docs/doxygen/html/classllvm_1_1LiveVariables.html
The text was updated successfully, but these errors were encountered: