[llvm-branch-commits] [clang] [llvm] [Coverage] Make additional counters available for BranchRegion. NFC. (PR #112730)
Jessica Paquette via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 18 19:59:29 PST 2024
================
@@ -1193,11 +1206,26 @@ std::pair<bool, bool> CodeGenPGO::getIsCounterPair(const Stmt *S) const {
}
void CodeGenPGO::emitCounterSetOrIncrement(CGBuilderTy &Builder, const Stmt *S,
+ bool UseSkipPath, bool UseBoth,
llvm::Value *StepV) {
- if (!RegionCounterMap || !Builder.GetInsertBlock())
+ if (!RegionCounterMap)
return;
- unsigned Counter = (*RegionCounterMap)[S].first;
+ unsigned Counter;
+ auto &TheMap = (*RegionCounterMap)[S];
+ auto IsCounter = TheMap.getIsCounterPair();
+ if (!UseSkipPath) {
+ if (!IsCounter.first)
+ return;
+ Counter = (TheMap.first & CounterPair::Mask);
----------------
ornata wrote:
This patch introduces a lot of code like
```
(X & CounterPair::Mask)
```
Would it make sense to create a small helper function to do this?
https://github.com/llvm/llvm-project/pull/112730
More information about the llvm-branch-commits
mailing list