google / autofdo

AutoFDO
https://groups.google.com/forum/#!forum/autofdo
Apache License 2.0
496 stars 109 forks source link

GCC12 use profiled created by create_gcov doesn't work #194

Open andyzhaozhenyu opened 1 month ago

andyzhaozhenyu commented 1 month ago

I tried to use Autofdo on GCC12 to optimize bubble_sort, but I checked the cfg. The count for basic block is not correct. 屏幕截图 2024-05-13 215538

erozenfeld commented 1 month ago

@andyzhaozhenyu andyzhaozhenyu Can you share the command lines and the output of your invocation of perf and create_gcov?

andyzhaozhenyu commented 1 month ago

gcc -g -O2 -o pmu test.c -fauto-profile=pmu.gcov -fdump-ipa-afdo-details /home/zzy/used/autofdo/autofdo-0.19/build/create_gcov --binary=baseline --profile=pmu.data --gcov=pmu.gcov --gcov_version=2 --use_lbr=0

And here is the output for dump_gcov

截屏2024-05-14 09 52 26
erozenfeld commented 4 weeks ago

@andyzhaozhenyu I tried this with my version of bubble_sort and GCC12 and I see that the counts are propagated correctly. Can you share your test.c and full output of gcc -g -O2 -o pmu test.c -fauto-profile=pmu.gcov -fdump-ipa-afdo-details ?