[PATCH] D101100: [ConstFold] Simplify a load's GEP operand through local aliases

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 2 13:58:11 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:877
+    while (isa<GlobalAlias>(Ptr) && !cast<GlobalAlias>(Ptr)->isInterposable() &&
+           !cast<GlobalAlias>(Ptr)->getBaseObject()->isInterposable()) {
+      Ptr = cast<GlobalAlias>(Ptr)->getAliasee();
----------------
This code uses a different check than the top-level case (https://github.com/llvm/llvm-project/blob/26223af256bb8f0aa1a82989882c81ffae44c6d1/llvm/lib/Analysis/ConstantFolding.cpp#L682-L684). Namely it also checks that the base object is not interposable. What's the reason for the difference? I'd expect both of them to use the same conditions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101100



More information about the llvm-commits mailing list