[PATCH] D17864: [PGO] Promote indirect calls to conditional direct calls with value-profile

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 11:45:21 PDT 2016


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

LGTM


================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:428
@@ +427,3 @@
+    PHI->addIncoming(V, IndirectCallBB);
+    PHI->setIncomingBlock(IX, DirectCallBB);
+  }
----------------
xur wrote:
> davidxl wrote:
> > xur wrote:
> > > davidxl wrote:
> > > > What is the phi arg value for this new incoming block?
> > > it's the same value as the one from OriginBB: in the two statements, the first only dup the value, and second one rest the incoming bb to DirectCallBB.
> > IF the value was the value from the original indirect call, should the new value become the result of the direct call?
> We have the special handling of the return value PHI. This only applies to the NormalDest. 
> 
> I assume UnwindBB won't use the return value. Let me know my assumption is incorrect.
> 
> This code handle the phi other than the return value PHI.
This assumption is probably correct -- in case of exception, the return value is not properly defined.


http://reviews.llvm.org/D17864





More information about the llvm-commits mailing list