[llvm-profgen] Fix bug of loop scope mismatch
authorwlei <wlei@fb.com>
Thu, 5 Aug 2021 03:20:58 +0000 (20:20 -0700)
committerwlei <wlei@fb.com>
Thu, 5 Aug 2021 23:52:57 +0000 (16:52 -0700)
commita8a38ef3d99ce2b180f9c5ff968e5b930a99b10b
treeff5a7e7b518b665012b26e4c071b18d131d5ec37
parent2b89f40a411cb9717232df61371b24d73ae84cb8
[llvm-profgen] Fix bug of loop scope mismatch

One performance issue happened in profile generation and it turned out the line 525 loop is the bottleneck.
Moving the code outside of loop scope can fix this issue. The run time is improved from 30+mins to ~30s.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D107529
llvm/tools/llvm-profgen/ProfileGenerator.cpp