[patch] Allow alias to point to an arbitrary ConstantExpr

Reid Kleckner rnk at google.com
Mon Jun 2 14:16:54 PDT 2014


lgtm

Thanks for working through this!  At the end of the day, I think it's
better that we don't have a new GEP-like alias construct that optimizations
have to worry about, even if we pay for it with less verifiable IR.


On Mon, Jun 2, 2014 at 1:37 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> > +  return DAG.getNode(XCoreISD::DPRelativeWrapper, dl, MVT::i32, GA);
> >
> > Just to check, there should be no behavioral change here, because
> getSection
> > now looks through aliases for us.
>
> Correct.
>
> > +// This is only used in aliases that we created and we know they have a
> > +// linear structure.
> > +static const llvm::GlobalObject *getAliasedGlobal(const
> llvm::GlobalAlias
> > &GA) {
> >
> > Can this be simplified with stripPointerCastsNoFollowAliases() wrapped
> with
> > a loop that follows getAliasee while inserting aliases into Visited?  For
> > that matter, does stripPointerCasts infloop on an alias cycle?
>
> I simplified it and the other cases you suggested. stripPointerCasts
> will not infinite loop it will return the GlobalAlias were it first
> finds the loop. We still need the set because stripPointerCasts will
> not walk past weak aliases (nor should it I think).
>
> We could add stripPointerCastsAndWeakAliases instead.
>
> Updated llvm and clang patches attached.
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140602/c05757f7/attachment.html>


More information about the llvm-commits mailing list