[PATCH] [GVN] Set proper debug locations for some instructions created by GVN.

Daniel Berlin dberlin at dberlin.org
Tue Jun 9 17:40:39 PDT 2015


On Tue, Jun 9, 2015 at 5:34 PM, Alexey Samsonov <vonosmas at gmail.com> wrote:
> In http://reviews.llvm.org/D10351#185934, @echristo wrote:
>
>> The GVN ones seem reasonable since the instructions they're replacing are deleted, are the ones in PHITransAddr the same?
>
>
> You could say so. Instructions created in PHITransAddr would eventually be used here:
>

This is not quite right, since in fact, it's replacing the address
computation, not the load.
Recursively, in fact, and sometimes, by grabbing random things it
finds in predecessor blocks that may or may not be in any way related
to the original address computation (they are only related in that
they appear to compute some part of it's value)

But you can't really do better in the world we have constructed :)


>   // Okay, we can eliminate this load by inserting a reload in the predecessor
>   // and using PHI construction to get the value in the other predecessors, do
>   // it.
>   DEBUG(dbgs() << "GVN REMOVING PRE LOAD: " << *LI << '\n');
>   DEBUG(if (!NewInsts.empty())
>           dbgs() << "INSERTED " << NewInsts.size() << " INSTS: "
>                  << *NewInsts.back() << '\n');
>
>
> http://reviews.llvm.org/D10351
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list