[PATCH] D89587: [CGSCC] Detect devirtualization in more cases

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 14:56:31 PST 2020


rnk added inline comments.


================
Comment at: llvm/include/llvm/Analysis/CGSCCPassManager.h:321
+  /// devirtualization.
+  SmallMapVector<Value *, WeakTrackingVH, 16> IndirectVHs;
 };
----------------
Using a Value pointer as a key seems like it could suffer from the ABA problem. Suppose a CallInst is deallocated and another is reallocated at the same address. The map will contain a false entry for the new call.

It seems like the lookup functionality (find/insert) is only needed during the update scan. You could build a map from Value* to handle index before that loop, and then do the instruction scan.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89587



More information about the llvm-commits mailing list