[PATCH] Update call graph after devirtualizing returned value

Pete peter_cooper at apple.com
Wed Jun 4 15:41:55 PDT 2014


Attached updated patch which addresses many of the points raised.

The main changes are to devirtualizedCallUsers which now walks uses looking for calls to devirtualize and through bit casts.  It simplifies bitcasts and updates the call graph for any calls which ultimately (even through bit casts) end up calling a Function* directly.  It now calls RAUW directly after it has noted down the interesting bit casts and calls.

I tried a few variations of this code and ultimately doing it in a few loops was cleanest.  The problem with a single large loop was determining whether a call we were visiting was devirtualized or not which isn't entirely clear once going through bit casts.

Also added 3 more tests which cover bit casting the call result value, the returned value, or both.  In each case it verifies that the appropriate simplifications were performed.

http://reviews.llvm.org/D4012

Files:
  lib/Transforms/IPO/Inliner.cpp
  lib/Transforms/Utils/InlineFunction.cpp
  test/Transforms/Inline/devirtualize-2.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4012.10111.patch
Type: text/x-patch
Size: 11742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140604/8aa8633b/attachment.bin>


More information about the llvm-commits mailing list