[patch] Allow alias to point to an arbitrary ConstantExpr

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Jun 2 13:37:07 PDT 2014


> +  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 --------------
A non-text attachment was scrubbed...
Name: llvm.patch
Type: text/x-patch
Size: 49026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140602/53b894f1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.patch
Type: text/x-patch
Size: 12962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140602/53b894f1/attachment-0001.bin>


More information about the llvm-commits mailing list