[PATCH] D77421: [WPD] Avoid noalias assumptions in unique return value optimization

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 23:57:57 PDT 2020


inglorion added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp:506
+  /// from assuming different names refer to different addresses.
+  ArrayType *VtableTy;
 
----------------
pcc wrote:
> Elsewhere I've called this `Int8Arr0Ty` but I'm not too picky about the name.
I've changed it to Int8Arr0Ty for consistency, and reworded the comment somewhat.


================
Comment at: llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp:1404
+  GlobalAlias *GA = GlobalAlias::create(
+      cast<PointerType>(C->getType())->getElementType(), 0,
+      GlobalValue::ExternalLinkage, getGlobalName(Slot, Args, Name), C, &M);
----------------
pcc wrote:
> Is this change necessary? As far as I know we aren't passing the result of `importGlobal` here and it would be nice to avoid introducing a call to `PointerType::getElementType()` given that we hope to eliminate it one day.
No, we can keep this as i8. I've removed this change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77421





More information about the llvm-commits mailing list