- User Since
- Jan 23 2017, 8:11 PM (86 w, 6 d)
Mon, Sep 17
LGTM, but please add CHECK-NOT into test to make sure that the metadata is actually dropped.
Sun, Sep 16
I would ask one more round of review for changes made to LangRef. I tried to make it more generic and less reliant on deopt's specifics than it used to be.
Made changes to LangRef to make the widening part independent on deoptimize intrinsic. After giving it some thought, I see no solid reason why we should impose any limitations on deopt block.
I don't see any fundamental flaws in the algorithm, it looks pretty robust. I have some nit comments, otherwise it LGTM. (Note that I'm maybe not the most qualified person to approve changes in such fundamental components as BasicBlock and Instruction, but this change seems profitable).
Fri, Sep 14
I tried to reformulate the semantics to make it independent on deoptimize intrinsic.
Thu, Sep 13
Rebased on top of D51664. This patch is really helpful here because it makes the invalidation of OrderedInstructions automatic. With that, we *only* need to invalidate whenever we may actually change the first ICF instruction or when we erase a basic block. With that, I've discarded most of invalidation we've added on the previous steps because it is actually not needed. We don't need to invalidate when we insert Phis or do stuff like that.
I've run a big corpus of fuzz tests on this patch and it passed OK. So the patch seems good to me in terms of stability. Unfortunately I don't have time to give a proper code review on that. :(
Wed, Sep 12
Abandoning in favor of https://reviews.llvm.org/D51664
Tue, Sep 11
Thanks @fhahn , I haven't seen it before. Actually after studying the code I came to the same conclusions as they did (that we only need to invalidate when we insert instructions or remove blocks). The mental problem I have is the comment for this class stating that: "A OrderedBasicBlock instance should be discarded whenever the source BasicBlock changes". This, in particular, means that I can check that we don't have dangling pointers whenever we make a request to this class...
https://reviews.llvm.org/D51664 This patch claims to make the OrderedInstructions auto-invalidable. If we build on top of that (and if it works :)), we may give up all invalidation stuff we currently have and only invalidate when we remove ICF instructions from blocks.
Mon, Sep 10
After digging deeper into the code, I grow more and more convinced that there was no bug to start with, and dangling pointers to instructions that are not tracked by ICF's map (even if they are tracked by OrderedInstructions) cause no problems.
Sun, Sep 9
Fri, Sep 7
Fixed LangRef, renamed pass to "MakeGuardsExplicit".
Thu, Sep 6
Wed, Sep 5
This patch has been reverted, the situation it protects against seems still possible. It means that the initial theory was true and we need a unit test on that.
This commit has caused massive buildbot failures on compilation, see for example http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/5953/steps/build%20stage%201/logs/stdio
I've just checked that this test now works fine. Apparently it was fixed somehow else, and I cannot construct another test where it matters. So let's just abandon it, not clear if it's needed anymore or not.
Tue, Sep 4
After offline discussion with Philip, we agreed on the following version: by default, we have one-block verification to keep compile time in reasonable bounds. For troubleshooting purposes, there is an option (false by default and with no intention to turn it on) to diagnose it. Assertion on destructor does not happen because we don't have a commitment to keep the information valid after the last point where the last query was made.
Added clarification comment, updated commit message to describe what is going on.
Now this is an NFC. We will visit every place where explicit guards need enabling independently.
Need to add tests on passes that use isGuard to see how they feel about it. Needs rework.
Fixed analysis preservation.
Fixed comments, added bundles to tests.