[PATCH] D71974: [Attributor][WIP] Connect AAIsDead with AAUndefinedBehavior

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 30 13:20:18 PST 2019


jdoerfert added a comment.

> There's one problem with that when I tried it in assumeLive(). It queries AAUB and blocks that are not yet known to cause UB are assumed live and are never re-tested.

I see. Now this becomes a little more involved. What we can do is to call `AAUB::isAssumedToCauseUB(BB.front())`. Since we haven't visited BB yet, we will say `true` if there are instructions in there that might cause UB.
Now, that will require us to keep track of the instruction that transferred control to BB as we have to ask AAUB again. Not in `assumeLive` but in the updateImpl, before the the `if(UsedAssumedInformation)` check, we can filter the `AliveSuccessors` based on `isAssumedToCauseUB(BB)`. If we filtered a block we need to set `UsedAssumedInformation` to true so we will revisit that instruction in the future. If `isAssumedToCauseUB(BB)` is true and `isKnownToCauseUB(BB)` as well, we can even remove the block without setting `UsedAssumedInformation`.

In D71974#1799188 <https://reviews.llvm.org/D71974#1799188>, @uenoku wrote:

> In D71974#1799138 <https://reviews.llvm.org/D71974#1799138>, @jdoerfert wrote:
>
> > 1. Since the must-be-executed-context is not collecting predecessors yet, we need to change that. The code actually exists already, it just needs to be separated from some other improvements and put for review again. I'll look into that (or @uenoku you can if you want to).
>
>
> I'd like to work on it.


Thx. There is a prototype patch out there that you can/should use as a starting point.


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

https://reviews.llvm.org/D71974





More information about the llvm-commits mailing list