[PATCH] D22600: [PGO] Fix profile mismatch in Comdat function with pre-inliner
Rong Xu via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 21 16:59:56 PDT 2016
xur marked 7 inline comments as done.
================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:344
@@ +343,3 @@
+ Comdat *C = F.getComdat();
+ for (auto &&CM : make_range(ComdatMembers.equal_range(C))) {
+ if (!dyn_cast<Function>(CM.second))
----------------
davidxl wrote:
> Also explain why having other variables are ok?
It turns out having variable in the comdat group is not safe to rename: if we rename the variable, we will create different copy of variable which is wrong. if we don't rename, we might run into duplicated symbol in linking.
So in the new patch, I disable the rename of the comdat groups with variables.
It's ok to have aliases though.
https://reviews.llvm.org/D22600
More information about the llvm-commits
mailing list