[PATCH] D93974: [ValueTracking] Safe assumption context for args

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 08:41:54 PST 2021


jdoerfert added a comment.

In D93974#2496824 <https://reviews.llvm.org/D93974#2496824>, @gilr wrote:

> In D93974#2494331 <https://reviews.llvm.org/D93974#2494331>, @jdoerfert wrote:
>
>> Oh.. this is bad. That happens if you mix two logically differnet things into a single instruction pointer.
>> I put it on the list of things that need to fixed wrt. assumes ... :(
>
> Excellent. Is the list published anywhere?

No, but maybe I should do that. Here is what I remember right now:

- Distinguish between the context location for which an assumption is queried and the instructions for which it is queried. Basically what is going "wrong" here. I assume tracking what assumptions have been used is the most efficient and if some were used and their operands include the instruction to be optimized, don't. Alternatively, pass the instruction and avoid dependent assumes. Other options are sensible as well.
- We did 1) from https://lists.llvm.org/pipermail/llvm-dev/2019-December/137632.html but not 2) and 3) yet. 2) is needed to lower `assert` in release mode and arbitrary `assumes` to IR. 3) is needed, among other things, for `pragma omp assumes` and `pragma omp assume`, see https://clang.llvm.org/docs/AttributeReference.html#assume and https://www.openmp.org/spec-html/5.1/openmpsu37.html#x56-560002.5.2
- This was just a WIP, needs verification and test changes: https://reviews.llvm.org/D89054 . This will most likely flush out a few bugs in our non-`speculatable` call handling.
- Rewriting more "boolean" assumption to high-level assume bundles. We could for example do pointer comparisons with `"eq/neq"(%ptr1, %ptr2)` and then teach the capture checker that those uses do not capture.
- Continue to preserve knowledge whenever we modify the IR. There were some large regressions before, I hope D89054 <https://reviews.llvm.org/D89054> will take care of some of that.

If you are interested in any of this, or something related, please let me know.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93974/new/

https://reviews.llvm.org/D93974



More information about the llvm-commits mailing list