[PATCH] D81911: [IR] Fix getBaseObject for GlobalAlias-to-GlobalIFunc

Dmitry Polukhin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 12:33:50 PDT 2020


DmitryPolukhin added a comment.

getBaseObject is only small part of code sharing, the majority of the code is outside the class in common code that handles both GlobalIFunc and GlobalAliases in the same way. Here they should be treated differently so, IMHO, there is no need in changing the inheritance but GlobalIFunc should be handles as a special case here.



================
Comment at: llvm/lib/IR/Globals.cpp:448
+  if (auto *GI = dyn_cast<GlobalIFunc>(C))
+    return findBaseObject(GI->getOperand(0), Aliases);
   if (auto *GA = dyn_cast<GlobalAlias>(C))
----------------
`return GI;` should work here I think. 


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

https://reviews.llvm.org/D81911





More information about the llvm-commits mailing list