[PATCH] D65115: IR: Teach GlobalIndirectSymbol::getBaseObject() to handle more kinds of expressions.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 09:26:03 PDT 2019


tejohnson added inline comments.


================
Comment at: llvm/lib/IR/Globals.cpp:436
+  if (auto *GIS = dyn_cast<GlobalIndirectSymbol>(C))
+    if (Aliases.insert(GIS).second)
+      return findBaseObject(GIS->getOperand(0), Aliases);
----------------
Why is this needed? Is it possible to have cycles in the indirection?


================
Comment at: llvm/lib/IR/Globals.cpp:441
+    case Instruction::Add: {
+      if (auto *GIS = findBaseObject(CE->getOperand(0), Aliases))
+        return GIS;
----------------
Is it possible for the other operand of the add (or subtract below) to be something that disqualifies this from analysis,  i.e. that needs checking?


================
Comment at: llvm/test/Linker/comdat8.ll:6
+ at some_name = unnamed_addr constant i32 42, comdat($c1)
+ at c1 = alias i8, inttoptr (i32 1 to i8*)
 
----------------
Why does this test change?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65115





More information about the llvm-commits mailing list