[PATCH] D110256: [SelectionDAG] Replace error prone index check in BaseIndexOffset::computeAliasing

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 00:39:40 PDT 2021


bjope added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp:156
+      auto *GV1 = cast<GlobalAddressSDNode>(BasePtr1.getBase())->getGlobal();
+      // It doesn't make sense to access one global value using another globals
+      // values address, so we can assume that there is no aliasing in case of
----------------
I'm not 100% sure about this. https://llvm.org/docs/LangRef.html#global-variables says that "code could assume that the globals are densely packed in their section and try to iterate over them as an array", so does that mean that for example a global variable `@foo` can be accessed using a global variable `@bar` as base ptr and with `(@bar - @foo)` as offset?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110256



More information about the llvm-commits mailing list