[PATCH] D30767: Updates branch_weights annotation for call instructions during inlining.

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 11:55:46 PDT 2017


eraman accepted this revision.
eraman added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:1441
+  for (auto const &Entry : VMap)
+    if (isa<CallInst>(Entry.first) && &*Entry.second != nullptr &&
+        isa<CallInst>(Entry.second))
----------------
danielcdh wrote:
> zzheng wrote:
> > Isn't it redundant to check ptr != nullptr?
> > 
> > Is there any chance that Entry.second is NULL and what happen on (*Entry.second) in that case?
> It indeed happened once when I compile large code, that's why I added this check. I'm not familiar with cloning code, Easwaran may have some insights on why this could be nullptr? Or it's a bug in function clone?
The value type of the VMap is WeakVH and the value it holds becomes null when it gets destroyed.


https://reviews.llvm.org/D30767





More information about the llvm-commits mailing list