This change is similar to http://gcc.gnu.org/PR90380.
This reduces the complexity from exponential to polynomial of the arcs.
Paths
| Differential D93036
[llvm-cov][gcov] Optimize the cycle counting algorithm by skipping zero count cycles ClosedPublic Authored by xinhaoyuan on Dec 10 2020, 8:21 AM.
Details Summary This change is similar to http://gcc.gnu.org/PR90380. This reduces the complexity from exponential to polynomial of the arcs.
Diff Detail
Event TimelineComment Actions Hi, This is the first patch I submitted to LLVM. Please let me know if anything is missing. Thanks! lebedev.ri retitled this revision from Optimize the cycle counting algorithm by skipping zero count cycles. This reduces the complexity from exponential to polynomial of the arcs. to [llvm-cov][gcov] Optimize the cycle counting algorithm by skipping zero count cycles. This reduces the complexity from exponential to polynomial of the arcs..Dec 10 2020, 8:57 AM MaskRay retitled this revision from [llvm-cov][gcov] Optimize the cycle counting algorithm by skipping zero count cycles. This reduces the complexity from exponential to polynomial of the arcs. to [llvm-cov][gcov] Optimize the cycle counting algorithm by skipping zero count cycles.Dec 10 2020, 9:52 AM Comment Actions Thanks for the patch! Probably worth mentioning that this is similar to http://gcc.gnu.org/PR90380 I believe this patch essentially uses David B Johnson's cycle enumeration algorithm to perform Klein's cycle cancelling method. I'll follow up and switch to Edmonds-Karp for simplicity. complex-line.gcno is too large (153KiB). If you name the source file a.c and use the relative filename when compiling, it can be smaller. Comment Actions Move the test to compiler-rt/test/profile, and get rid of the generated files. Also add a check to match the result count. This revision is now accepted and ready to land.Dec 10 2020, 2:46 PM This revision was landed with ongoing or failed builds.Dec 10 2020, 3:22 PM Closed by commit rG97260ab4786f: [llvm-cov][gcov] Optimize the cycle counting algorithm by skipping zero count… (authored by xinhaoyuan, committed by MaskRay). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 311038 compiler-rt/test/profile/gcov-complex-line.c
llvm/include/llvm/ProfileData/GCOV.h
llvm/lib/ProfileData/GCOV.cpp
|
This line can be deleted since checking the existence of .gcno is out of the scope of this patch.