[llvm] r314435 - [JumpThreading] Preserve DT and LVI across the pass

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 08:55:55 PDT 2017


On Mon, Oct 16, 2017 at 7:48 AM, Brian M. Rzycki <brzycki at gmail.com> wrote:

> Sounds good. I want to make sure you feel like you can make forward
>> progress as quickly as possible (I know starting to fix all this has been a
>> drag), so if you want to do it earlier, let me know and we'll figure
>> something out :)
>
> Thanks Daniel for all the help. If it needs more work to be done right
> then I'll get on it. I want to make sure we get it right. :)
>
>  I was thinking about this over the weekend and I was thinking of a new
> class named DeferredDeviceTree or DeviceTreeDeferred.
>

(I assume you meant dominator)

So let me try to give you my ideal design goals:
1. Be able to update the postdominatortree if it's around
2. Be able to update the dominatortree if it's around
(The same edge updates will work for both)
3. Only have to add one argument to existing functions to do #1 and #2
4. Only have one updater object/class that things have to use to do #1 and
#2

The easiest option i see to do this:
Make an updater object that can take a DT and a PDT pointer, and internally
apply the same edge updates to both. Modify everywhere to use it.

For example, you don't want everywhere to have to do

DT->insertedge(a, b)
PDT->insertedge(a, b)

The only thing this invites is getting one of the lines wrong by accident
(or forgetting it).

Would it be okay if we had to?
Sure, but i don't (right now) see the advantage over an updater object.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171016/04c39b69/attachment.html>


More information about the llvm-commits mailing list