[PATCH] D22600: [PGO] Fix profile mismatch in Comdat function with pre-inliner

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 12:06:24 PDT 2016


davidxl added inline comments.

================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:348
@@ +347,3 @@
+  // non-trivial code refactoring to do this efficiently.
+  // (2) For a Comdat group containing a variable member, we should not create
+  // multiple copies for the variable.
----------------
(2) variables can not be renamed, so we can not rename comdat function in a group including global vars.

================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:393
@@ +392,3 @@
+      // For aliases, change the name directly.
+      GA->setName(Twine(GA->getName() + "." + Twine(FunctionHash)));
+      continue;
----------------
Add assert that the alias target is still F

================
Comment at: test/Transforms/PGOProfile/comdat_rename.ll:2
@@ +1,3 @@
+; RUN: opt < %s -pgo-instr-gen -S | FileCheck %s
+; RUN: opt < %s -passes=pgo-instr-gen -S | FileCheck %s
+
----------------
you may want to try this test case on other platform such as coff to make sure it works:

 -mtriple=x86_64-pc-win32-coff 


https://reviews.llvm.org/D22600





More information about the llvm-commits mailing list