[all-commits] [llvm/llvm-project] 284da0: [coro][pgo] Don't promote pgo counters in the susp...
Mircea Trofin via All-commits
all-commits at lists.llvm.org
Thu Nov 30 11:58:42 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 284da049f5feb62b40f5abc41dda7895e3d81d72
https://github.com/llvm/llvm-project/commit/284da049f5feb62b40f5abc41dda7895e3d81d72
Author: Mircea Trofin <mtrofin at google.com>
Date: 2023-11-30 (Thu, 30 Nov 2023)
Changed paths:
M llvm/include/llvm/Transforms/Instrumentation/CFGMST.h
M llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
M llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
A llvm/test/Transforms/Coroutines/coro-split-musttail-chain-pgo-counter-promo.ll
M llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp
Log Message:
-----------
[coro][pgo] Don't promote pgo counters in the suspend basic block (#71263)
If a suspend happens in the resume part (this can happen in the case of chained coroutines), and that's part of a loop, the pre-split CFG has the suspend block as an exit of that loop. PGO Counter Promotion will then try to commit the temporary counter to the global in that "exit" block (it also does that in the other loop exit BBs, which also includes
the "destroy" case). This interferes with symmetric transfer.
We don't need to commit the counter in the suspend case - it's not a loop exit from the perspective of the behavior of the program. The regular loop exit, together with the "destroy" case, completely cover any updates that may need to happen to the global counter.
More information about the All-commits
mailing list