[PATCH] D18624: [PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name.

Rong Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 15:17:21 PDT 2016


xur updated this revision to Diff 54275.
xur added a comment.

Previous patch was bad (as David noticed) -- we might not annotate all the functions that we interested.

This updated patch should work.

BTW, I got the following promotions for 453.provay:

LLVM gold plugin: csg.cpp:157:15: Promote indirect call to _ZN3povL23All_Plane_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 1654869 out of 1695169
LLVM gold plugin: csg.cpp:157:15: Promote indirect call to _ZN3povL31All_CSG_Intersect_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 40300 out of 40300
LLVM gold plugin: csg.cpp:252:11: Promote indirect call to _ZN3povL24All_Sphere_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 72389427 out of 132687016
LLVM gold plugin: csg.cpp:252:11: Promote indirect call to _ZN3povL23All_Plane_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 44987633 out of 60297589
LLVM gold plugin: lighting.cpp:828:11: Promote indirect call to _ZN3povL31All_CSG_Intersect_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 271222 out of 581624
LLVM gold plugin: lighting.cpp:828:11: Promote indirect call to _ZN3povL27All_Ellipsoid_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 220561 out of 310402
LLVM gold plugin: objects.cpp:111:7: Promote indirect call to _ZN3povL31All_CSG_Intersect_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 14382553 out of 16537858
LLVM gold plugin: objects.cpp:111:7: Promote indirect call to _ZN3povL23All_Plane_IntersectionsEPNS_13Object_StructEPNS_10Ray_StructEPNS_13istack_structE with count 1489615 out of 2155305
LLVM gold plugin: objects.cpp:175:11: Promote indirect call to _ZN3povL12Inside_PlaneEPdPNS_13Object_StructE with count 50136636 out of 70129039
LLVM gold plugin: objects.cpp:175:11: Promote indirect call to _ZN3povL14Inside_QuadricEPdPNS_13Object_StructE with count 16280600 out of 19992403
LLVM gold plugin: render.cpp:3579:9: Promote indirect call to _ZN3povL23Inside_CSG_IntersectionEPdPNS_13Object_StructE with count 4065174 out of 4516860
LLVM gold plugin: render.cpp:3579:9: Promote indirect call to _ZN3povL12Inside_PlaneEPdPNS_13Object_StructE with count 451686 out of 451686
LLVM gold plugin: spec_qsort.cpp:38:14: Promote indirect call to _ZN3povL9compboxesEPvS0_ with count 9339 out of 9339
LLVM gold plugin: textstreambuffer.cpp:278:4: Promote indirect call to _ZN12pov_frontend21DefaultRenderFrontend19DefaultStreamBuffer12directoutputEPKcj with count 9922 out of 9924
LLVM gold plugin: textstreambuffer.cpp:237:4: Promote indirect call to _ZN12pov_frontend21DefaultRenderFrontend19DefaultStreamBuffer10lineoutputEPKcj with count 9922 out of 9924

Adam: Could you try again?

Thanks,

-Rong


http://reviews.llvm.org/D18624

Files:
  lib/CodeGen/CodeGenPGO.cpp

Index: lib/CodeGen/CodeGenPGO.cpp
===================================================================
--- lib/CodeGen/CodeGenPGO.cpp
+++ lib/CodeGen/CodeGenPGO.cpp
@@ -43,6 +43,9 @@
 
 void CodeGenPGO::setFuncName(llvm::Function *Fn) {
   setFuncName(Fn->getName(), Fn->getLinkage());
+  // Create PGOFuncName meta data.
+  if (!llvm::getPGOFuncNameMetadata(*Fn))
+    llvm::createPGOFuncNameMetadata(*Fn);
 }
 
 namespace {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18624.54275.patch
Type: text/x-patch
Size: 425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160419/8ed98da1/attachment-0001.bin>


More information about the cfe-commits mailing list