[PATCH] D99240: [ConstantFolding] Look through local aliases when simplify GEPs

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 15:23:36 PDT 2021


rnk added subscribers: erichkeane, pcc.
rnk added a comment.

+ at pcc who added the test and @ErichKeane who adjusted the API recently

Some proir art:
https://reviews.llvm.org/rG2452d7030b84d358165f5f76c9270937b4ea1a91
https://reviews.llvm.org/D68584



================
Comment at: llvm/lib/IR/Value.cpp:612-613
       V = cast<GlobalAlias>(V)->getAliasee();
+    } else if (StripKind == PSK_ZeroIndicesAndLocalAliases &&
+               isa<GlobalAlias>(V) && cast<GlobalAlias>(V)->hasLocalLinkage()) {
+      V = cast<GlobalAlias>(V)->getAliasee();
----------------
I wonder if it would be safe to power up all of the other versions of pointer stripping to look through local aliases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99240



More information about the llvm-commits mailing list