<div dir="ltr">> Thanks for such a detailed explanation!<div>> I'll have to study your mail and try out some things before I can ask specific questions for further discussion. <br><br>No problem, follow-up with questions if any.<br><br>> <span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">I totally agree with your point of drawing diagrams about different parts of the code. I tried this but was not able to succeed. It would be very helpful if you can tell me what is the entry point of Attributor (which method is called the very first time?)?
It's runAttributorOnFunctions. I'm not sure it's good to start seeing the whole picture right now, but in any case, you can follow that if at any point you want.
</span><div><span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">> Also, is there any way we can debug opt command in gdb like fashion (ie. setting breakpoints, stepping through instructions one by one?)?
It depends on how you built LLVM. If you built it with -DCMAKE_BUILD_TYPE=Release, you can't. However note that if you built it in Release with asserts on, i.e. -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=On,
you'll have the -debug option in opt, which can be useful at times.
To be able to have debug info, you have to build it with RelWithDebInfo or Debug (in CMAKE_BUILD_TYPE, check: </span><a href="https://llvm.org/docs/CMake.html">https://llvm.org/docs/CMake.html</a><span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">). Although in the former, even if you enable assertions, for some reason you don't have -debug last time I checked. </span><span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">Note that in both of these settings, the binary size (and the compilation time) grow a lot (i.e. several tens of gigabytes in Debug IIRC).
Best,
Stefanos Baziotis</span></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Δευ, 16 Μαρ 2020 στις 5:52 π.μ., ο/η Fahad Nayyar <<a href="mailto:fahad17049@iiitd.ac.in">fahad17049@iiitd.ac.in</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Dear Stefanos,<div><br></div><div>Thanks for such a detailed explanation!</div><div>I'll have to study your mail and try out some things before I can ask specific questions for further discussion. </div><div><br></div><div>But I want to discuss this point right away:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><b>> <span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">I'd start by doing diagrams about how different parts of the code interact with each other (e.g. where does the Attributor start? </span><span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">what does it call then? how are attributes created? etc.) When starting out, these things might not be important to tackle. But they helped me.</span></b></div></blockquote><div><span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">I totally agree with your point of drawing diagrams about different parts of the code. I tried this but was not able to succeed. It would be very helpful if you can tell me what is the entry point of Attributor (which method is called the very first time?)? </span></div><div><span style="font-family:Arial;font-size:14.6667px;white-space:pre-wrap">Also, is there any way we can debug opt command in gdb like fashion (ie. setting breakpoints, stepping through instructions one by one?)?</span></div><div>This would help me a lot in the initial code reading period.</div><div><br></div><div>Thanks and Regards</div><div>Fahad Nayyar<br><br><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 16, 2020 at 7:23 AM Stefanos Baziotis <<a href="mailto:stefanos.baziotis@gmail.com" target="_blank">stefanos.baziotis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Farad,<br><br>> <span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-family:Arial;vertical-align:baseline;white-space:pre-wrap">I tried to do this for the </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-family:Arial;font-weight:700;vertical-align:baseline;white-space:pre-wrap">NoUnwind</span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-family:Arial;vertical-align:baseline;white-space:pre-wrap"> attribute
Hmm, I don't have experience with this attribute but it seems like a good starting point since it doesn't do much. First of all, be sure that you run with:
<span style="font-size:14.6667px;font-style:italic;font-weight:700">opt -passes=attributor -attributor-disable=false
</span>
This uses the new pass manager which is another discussion. Now, to the point:
If you open nounwind.ll, it has a bunch of test cases and I don't think it's a good idea to run Attributor in all of them at first. So, break it into individual tests.
First of all, note that the Attributor follows an optimistic path to attribute deduction. That is, you always start assuming that an attribute is valid
until you have info that it isn't. Seeing TEST 1 should be relatively obvious that it doesn't have something that breaks the initial assumption, that's why you see no change in state
between calls to updateImpl().
But now we have to dig deeper: What can break our initial assumption (which is that a function does not throw) in the case of NoUnwind?
You see in the topmost updateImpl() that they're a bunch Opcodes. Those are instructions (inside our function) that can potentially break our initial assumption (e.g. call to a function that
either we know it throws or at least it is not guaranteed that it doesn't). In the updateImpl(), using checkForAllInstructions, we loop through all those instructions and call for each one the predicate
CheckForNoUnwind. Note a couple of things:
- TEST 1 has no such instructions whatsoever so if you put a print inside the predicate, you'll see nothing.
- You can see that the predicate returns a boolean value. If it's true, we continue to the next instruction, otherwise we stop. If we make it through all of them, checkForAllInstructions() returns
true. Otherwise false. The predicate checks if any instruction breaks our assumption (we'll see shortly how). If it does, we immediately indicate pessimistic fixpoint.
What about TEST 2 and 3 ? Those 2 functions have a call inside but if you put a print inside the predicate, you'll see again nothing. The reason for that brings us to an important
part of the Attributor and that is that "deadness" (and the relative attribute) is very important. checkForAllInstructions() will only go through instructions that are considered live. The 2 calls are not considered
because another part of the Attributor (which is out of topic right now) has (somewhat) deduced that they go in an endless recursion.
If you run the Attributor with these 2 functions you'll see another important point. Specifically that the function bodies have only an `unreachable` instruction inside. That is, the attributor
not only deduces (and provides) info through attributes but it also transforms code. In this case it changed the function bodies to unreachable.
Finally, I think it's interesting to see TEST 4: You see that it calls a function that we don't know it doesn't throw. This should break our assumption. And it does.
Inside the topmost updateImpl() and inside the predicate, if you put a print, you'll see the call (e.g. dbgs() << I << "\n").
We ask I.mayThrow(). Note that mayThrow() will return false in the case that we're somehow sure that the instruction does not throw. In this case the instruction is a call, so it will return true if we're sure
that the called function does not throw. But we're not, so we move forward.
What then happens is a little bit weird but it basically AANoUnwind asks AANoUnwindCallSite for info because this instruction is a call site. Attributes ask one another and this is very important
in the Attributor because one's information is useful in another. We do it with getAAFor. Without getting into too much info, the other attribute says that it's not assumed unwind so we
indicate pessimistic fixpoint (the reality is that the order of calls between the attributes is reverse, but again, out of topic).
I hope that gave you a better understanding!
> <span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline">I know how in</span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-weight:700;vertical-align:baseline"> [1]</span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline"> Johaanes explained the use of </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-weight:700;vertical-align:baseline">MaxObjSize</span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline"> and </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-weight:700;vertical-align:baseline">Dereferenceable </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline">in the </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-weight:700;vertical-align:baseline">AliasAnalysis. </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline">But I would be happy if I could come up with some even better example.
</span>As you said, that'll probably take some time but that's ok There are opportunities everywhere. For example, consider this:
<a href="https://godbolt.org/z/HFWo_J" target="_blank">https://godbolt.org/z/HFWo_J</a>
It's a for loop that does a load inside from %p. The load seems to be invariant, we could move it out of the loop. -licm in the cmd arguments means it invokes the Loop-Invariant Code Motion pass,
which does such things. But it doesn't move the load out. The reason for that is that consider the case where %n == 0 and %p == null. In the initial code, we would never get into the loop
and we would not have a trap. While, with this transformation, we will have and thus, we just changed the initial behavior. So, the transformation is not done. However, if you put
dereferenceable(4) attribute in %p, it will be done. Because now you now you can certainly dereference. So, attribute info is useful in ways we may not consider :)
> <span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline">I can start with TODO at line no. 2605 </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-weight:700;vertical-align:baseline">// TODO: Return the number of reachable queries.
</span>I'm not familiar with it. Currently it doesn't seem to do anything but I may miss something. I suppose what it asks is to track how many queries to this attribute have been done by outside users which should be easy.
> <span style="font-size:14.6667px">Since the code is very large right now, I thought to refer to some of the very initial patches of attributor
</span>Maybe, I don't know. But I assume things will have changed from then and you may get lost. I'd start by doing diagrams about how different parts of the code interact with each other (e.g. where does the Attributor start?
what does it call then? how are attributes created? etc.) When starting out, these things might not be important to tackle. But they helped me.
<span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline">> How should I indicate to the community that I have started working towards this issue (should I comment on the issue page on github?)? I can try to work on </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;font-weight:700;vertical-align:baseline">AAReachability TODO </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;font-size:11pt;vertical-align:baseline">after solving this issue.</span><br>You can write it in the Github comments. I don't think you can / need to do something else.
Kind regards,
Stefanos Baziotis</span></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Δευ, 16 Μαρ 2020 στις 12:12 π.μ., ο/η Fahad Nayyar <<a href="mailto:fahad17049@iiitd.ac.in" target="_blank">fahad17049@iiitd.ac.in</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><span id="gmail-m_-5959994705320785714gmail-m_2239008474251680025gmail-m_-4881969029287863206gmail-docs-internal-guid-f6c5afb5-7fff-4d2c-7d4f-9044d69d2af9"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Dear Stefan and Stefanos,</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Thanks for your suggestions!</span></p><br><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">> I'd suggest that you try to run the Attributor and follow a specific attribute's updates and see what it tries to deduce. That is, see its updateImpl(). With a couple of prints you can get a good idea of what it does and what info it gets from other attributes (and when it stops).</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I tried to do this for the </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">NoUnwind</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> attribute. I printed </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">getState(),</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> i</span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">sAssumedNoUnwind()</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">isKnownNoUnwind()</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> in </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">updateImpl</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> method of classes </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AANoUnwind</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> and </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AANoUnwindCallSite</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. I run the tests in </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">nounwind.ll </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">(/llvm/test/Transforms/Attributor/nounwind.ll). I used this command to run the test: </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">“opt -attributor -attributor-disable=false nounwind.ll -S &> nounwind_out.ll”. </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">But </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">After seeing the output I was not able to understand how the attribute is changing for the tests. Its status was almost constant every time </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">updateimp </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">was called. Please tell me what other things should I try to print to better observe how the </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">NoUnwind </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">attribute is changing over the iterations of fix point analysis. Also please verify whether I am using the correct command to run the tests.</span></p><br><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">> Also, probably this will be a very interesting panel discussion for you: </span><a href="https://www.youtube.com/watch?v=cC2cspQgSxM" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">https://www.youtube.com/watch?v=cC2cspQgSxM</span></a></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Thanks for suggesting this! I watched the video and now I understand the pros and cons of inlining. But I still think that It would take me a while before I can come up with a very good example demonstrating the use of of of the Attribues in some IPO pass. I know how in</span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> [1]</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> Johaanes explained the use of </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">MaxObjSize</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> and </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Dereferenceable </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">in the </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AliasAnalysis. </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">But I would be happy if I could come up with some even better example.</span></p><br><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">> You are somewhat right. However, H2S is not about 'use-after-free' bug detection, but rather its prevention. We already do this, see </span><a href="https://godbolt.org/z/HgrC7H" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">example.</span></a></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Thanks for sharing the example. Just for clarification, was this example demonstrating the point that we can automatically correct use-after-free bugs using attributes? If yes, then I didn’t understand how and which attribute helped in this correction? Also is it not wrong to change the IR as in this example? Replacing</span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> %1 = tail call noalias i8* @malloc(i64 4) ; tail call void @no_sync_func(i8* %1)</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> with </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">%1 = alloca i8, i64 4 </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">solved the use-after-free bug, but doesn’t it also change the semantic of the program?</span></p><br><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">> In the meantime you could look at some TODOs in the Attributor itself and try those you see fit.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I looked up some of the TODOs. I found </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AAReachability </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">a very interesting attribute. I can start with TODO at line no. 2605 </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">// TODO: Return the number of reachable queries.</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> I can work towards this TODO. But I first want your advice on whether it looks doable for me. I can see that implementation of </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AAReachability </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">attribute is not complete yet</span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I can try to learn more about it from </span><a href="https://reviews.llvm.org/D70233" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">D70233 </span></a><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">and</span><a href="https://reviews.llvm.org/D71617" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap"> D71617</span></a><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I am trying to get more familiar with Attributor’s code. Since the code is very large right now, I thought to refer to some of the very initial patches of attributor (</span><a href="https://reviews.llvm.org/D59918" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">D59918,</span></a><a href="https://reviews.llvm.org/D60012" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap"> D60012</span></a><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">,</span><a href="https://reviews.llvm.org/D63379" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap"> D63379</span></a><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">). I believe that by looking at these three I can get a better idea of the framework as a whole. Please suggest if this is a good idea or not. Also please suggest any other way by which I can improve my understanding of the code.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I can see that Johanned have put up some issues for GSOC aspirants. I think that </span><a href="https://github.com/llvm/llvm-project/issues/179" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">[2]</span></a><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">([Attributor] Cleanup and upstream `Attribute::MaxObjectSize`)</span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> will be a very good issue for me, It seems doable and I can get familiar with the whole process of writing a patch for an issue. How should I indicate to the community that I have started working towards this issue (should I comment on the issue page on github?)? I can try to work on </span><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AAReachability TODO </span><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">after solving this issue.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Thanks and Regards</span></p><br><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">References</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[1] </span><a href="https://youtu.be/HVvvCSSLiTw" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">https://youtu.be/HVvvCSSLiTw</span></a></p><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[2] </span><a href="https://github.com/llvm/llvm-project/issues/179" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">https://github.com/llvm/llvm-project/issues/179</span></a></span><br><br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 14, 2020 at 4:12 PM Stefan Stipanovic <<a href="mailto:stefomeister@gmail.com" target="_blank">stefomeister@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Fahad,</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-variant-numeric:normal;font-variant-east-asian:normal;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:11pt;white-space:pre-wrap;vertical-align:baseline">> Improve dynamic memory related capabilities of Attributor. For example Improve </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:11pt;white-space:pre-wrap;font-weight:700;vertical-align:baseline">HeapToStackConversions</span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:11pt;white-space:pre-wrap;vertical-align:baseline">. Maybe such deductions can help safety (dis)provers. For example, can we improve the </span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:11pt;white-space:pre-wrap;font-weight:700;vertical-align:baseline">use-after-free bug detection</span><span style="font-variant-numeric:normal;font-variant-east-asian:normal;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:11pt;white-space:pre-wrap;vertical-align:baseline"> using some attributes?
</span><br>Stefan should know more about H2S. Regarding the use-after-free, I don't think there's currently any plans for it directly, but they can be I assume.</blockquote><div> </div><div>You are somewhat right. However, H2S is not about 'use-after-free' bug detection, but rather its prevention. We already do this, see <a href="https://godbolt.org/z/HgrC7H" target="_blank">example</a>.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In the rest of this post I'll try to help you familiarize yourself with the Attributor and maybe answer your questions.<br>Johannes can then give you specific things to do to get started.</blockquote><div><br></div><div>In the meantime you could look at some TODOs in the Attributor itself and try those you see fit. </div><div><br></div><div>If you have any questions, don't hesitate to ask.</div><div><br></div><div>-stefan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 13, 2020 at 10:14 PM Stefanos Baziotis <<a href="mailto:stefanos.baziotis@gmail.com" target="_blank">stefanos.baziotis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Fahad,<br><br>We're all happy to see you being interested in LLVM! More so in the Attributor! I'm a relatively new contributor so I<br>think I can help. Please note that the Attributor, apart from Johannes (who CC'd), has at least another 2 great<br>contributors, Hideto and Stefan (who I also CC'd). They were among the initial creators.<br><br>In the rest of this post I'll try to help you familiarize yourself with the Attributor and maybe answer your questions.<br>Johannes can then give you specific things to do to get started.<br><br>Starting off, understanding the theory of data-flow analysis can help. I'd say don't get too hang up on it, you just<br>have to understand the idea of fix-point analyses.<br><br>I don't how much you know about the Attributor, so I'll defer a too long (or too beginner) description because you might already know<br>a lot of things. You can of course any specific questions you want:<br>A summary is:<br>The Attributor tries to deduce attributes in different points of an LLVM IR program (you can see that in the video).<br>The deduction of these attributes is inter-connected, which is the whole point of the Attributor. The attributes<br>"ask" one another for information. For example, one attribute tries to see if a load loads from null pointer.<br>But the pointer operand might be non-constant (like %v in LLVM IR). Well, another attribute, whose job is to do value simplification<br>(i.e. constant folding / propagation etc.) might have folded that (%v) into the constant null. So, the former can ask him.<br>These connections give the power and the complexity.<br><br>The attributes have a state, that changes. When the state stops changing, it has reached a fixpoint, at which point<br>the deduction of it stops. From the initialization of the attribute until a fixpoint is reached, the state changes<br>in updates (called updateImpl() in the source code). This is where attributes try to deduce new things, ask one another<br>and eventually try to reach a fixpoint.<br><br>Finally, a fixpoint can be enforced. Because if we for some reason never stop changing, it would run forever.<br>Note however that attributes should be programmed in a way that fixpoint should be able to be reached<br>(This is where theory might help a little).<br><br>I'd suggest that you try to run the Attributor and follow a specific attribute's updates and see what it tries to deduce.<br>That is, see its updateImpl(). With a couple of prints you can get a good idea of what it does and what info it<br>gets from other attributes (and when it stops). You can of course ask us if you're interested in a specific one, if<br>there's something you don't understand etc.<br><br>Now, to (try to) answer your questions and hopefully other people can help.<br>> <span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline">How Attributor can help for standard inter-procedural and intra-procedural analysis passes of LLVm. I’ve seen the tutorial</span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;font-weight:700;vertical-align:baseline"> [4]</span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline">. I would like to discuss ways of improving other optimization passes similarly (or some examples which have already been implemented).</span><br><br>The Attributor AFAIK is self-contained. It's not in "production" yet and so it's not connected with other passes. At this point, LLVM is focused on heavy inlining, which while very useful, you'll lose a lot of the interprocedural information.<br>Note that there are other transforms that do Inter-Procedural Optimization (<a href="https://github.com/llvm/llvm-project/tree/master/llvm/lib/Transforms/IPO" target="_blank">https://github.com/llvm/llvm-project/tree/master/llvm/lib/Transforms/IPO</a>) but they don't follow the idea of the Attributor.<br>But they might follow a fix-point analysis.<br><br><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline">> Improve dynamic memory related capabilities of Attributor. For example Improve </span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;font-weight:700;vertical-align:baseline">HeapToStackConversions</span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline">. Maybe such deductions can help safety (dis)provers. For example, can we improve the </span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;font-weight:700;vertical-align:baseline">use-after-free bug detection</span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline"> using some attributes?
</span><br>Stefan should know more about H2S. Regarding the use-after-free, I don't think there's currently any plans for it directly, but they can be I assume.<br><br>> <span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline">Improve Liveness related capabilities of Attributor. Again I want to consider whether some attribute deduction can help liveness (dis)provers. For example </span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;font-weight:700;vertical-align:baseline">NoReturn, WillReturn</span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline"> can be improved. I am sure these 2 attributes do not cover all the cases as it is an undecidable problem. But I was wondering whether there is room for improvement in their deduction mechanism.
Liveness is certainly something that we're currently trying to improve and I don't think we'll ever stop. Most of the attributes interact with the deadness attribute (AAIsDead) both for asking it info and
providing it info (i.e. the undefined-behavior attribute hopefully will at some point be able to tell AAIsDead that a block is dead because it contains UB).
> </span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline">Is there any attribute that tells whether a function has </span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;font-weight:700;vertical-align:baseline">side-effects</span><span style="color:rgb(0,0,0);font-family:Arial;font-size:11pt;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre-wrap;background-color:transparent;vertical-align:baseline"> (does it always gives the same output for the same input? Or does it affect some global variable directly or indirectly?)?
No AFAIK, although you might be interested in this: </span><a href="https://reviews.llvm.org/D74691#1887983" target="_blank">https://reviews.llvm.org/D74691#1887983</a><br><br>I hope this was helpful! Don't hesitate to ask any questions.<br><br>Kind regards,<br>Stefanos Baziotis</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Παρ, 13 Μαρ 2020 στις 10:25 μ.μ., ο/η Fahad Nayyar via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Hi all,</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">My name is Fahad Nayyar. I am an undergraduate student from India. </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I am interested to participate in GSOC under the project </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">“Improve inter-procedural analyses and optimizations”. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I have been using LLVM for the past 8 months. I have written various intra-procedural analysis in LLVM as FunctionPass for my course projects and research projects. But I’ve not contributed to the LLVM community yet. I am very excited to contribute to LLVM! </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I am not too familiar with the inter-procedural analysis infrastructure of LLVM. I have written small toy inter-procedural dataflow analysis (like taint analysis, reaching definitions, etc) for JAVA programs using SOOT tool <b>[5].</b> I am familiar with the theory of inter-procedural analysis (I’ve read some chapters of </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[1]</span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[2] </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">and</span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> [3]</span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> for this).</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">I am trying to understand the LLVM’s </span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Attributor framework</span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">. I am interested in these 3 aspects:</span></p><ol style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="margin-left:15px;list-style-type:decimal;font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">How Attributor can help for standard inter-procedural and intra-procedural analysis passes of LLVm. I’ve seen the tutorial</span><span style="font-size:11pt;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline"> [4]</span><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">. I would like to discuss ways of improving other optimization passes similarly (or some examples which have already been implemented).</span></p></li><li dir="ltr" style="margin-left:15px;list-style-type:decimal;font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">Improve dynamic memory related capabilities of Attributor. For example Improve </span><span style="font-size:11pt;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">HeapToStackConversions</span><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">. Maybe such deductions can help safety (dis)provers. For example, can we improve the </span><span style="font-size:11pt;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">use-after-free bug detection</span><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline"> using some attributes?</span></p></li><li dir="ltr" style="margin-left:15px;list-style-type:decimal;font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">Improve Liveness related capabilities of Attributor. Again I want to consider whether some attribute deduction can help liveness (dis)provers. For example </span><span style="font-size:11pt;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">NoReturn, WillReturn</span><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline"> can be improved. I am sure these 2 attributes do not cover all the cases as it is an undecidable problem. But I was wondering whether there is room for improvement in their deduction mechanism.</span></p></li><li dir="ltr" style="margin-left:15px;list-style-type:decimal;font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">Can we optimize the attribute deduction algorithm to reduce compile time?</span></p></li><li dir="ltr" style="margin-left:15px;list-style-type:decimal;font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">Is there any attribute that tells whether a function has </span><span style="font-size:11pt;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline">side-effects</span><span style="font-size:11pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline"> (does it always gives the same output for the same input? Or does it affect some global variable directly or indirectly?)?</span></p></li></ol><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">It would be great if Johannes can provide me some TODOs before submitting my proposal. Also please tell some specific IPO improvement goals which you have in mind for this project. I would be most interested in memory-related attributes, liveness deductions from attributes and measurable better IPO using attribute deduction.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Thanks and Regards.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">References:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[1] </span><a href="https://www.springer.com/gp/book/9783540654100" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">Principles of Program Analysis.</span></a></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[2] </span><a href="https://dl.acm.org/doi/book/10.5555/1592955" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">Data Flow Analysis: Theory and Practice.</span></a></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[3] </span><a href="https://cs.au.dk/~amoeller/spa/spa.pdf" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">Static Program Analysis.</span></a></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[4] </span><a href="https://www.youtube.com/watch?v=HVvvCSSLiTw" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">2019 LLVM Developers’ Meeting: J. Doerfert “The Attributor: A Versatile Inter-procedural Fixpoint.."</span></a></p><span style="font-variant-numeric:normal;font-variant-east-asian:normal;background-color:transparent;font-size:11pt;font-family:Arial;color:rgb(0,0,0);font-weight:700;vertical-align:baseline;white-space:pre-wrap">[5] </span><a href="https://github.com/Sable/soot" style="text-decoration-line:none" target="_blank"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">Soot - A Java optimization framework</span></a><br><br><br><br><img width="0" height="0" alt="" style="display: flex;"></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div><img width="0" height="0" alt="" style="display: flex;"></div>
</blockquote></div>
</blockquote></div><img width="0" height="0" alt="" style="display: flex;" src="https://mailtrack.io/trace/mail/14f2302c4746cacf6f3b4324b679c73741333d88.png?u=2246830"></div>
</blockquote></div>