[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-23 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @Lambdaris I have #112730 as well. https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-23 Thread via cfe-commits
Lambdaris wrote: This patch also helps to distinguish constants from rust, in which constant may have only one counter hard coded to `Zero`, thank you! Besides, I found that with this change we should also count false counter id when [calculating max `CounterID`](https://github.com/llvm/llvm-

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-19 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime` running on `omp-vega20-0` while building `clang,llvm` at step 7 "Add check check-offload". Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/8580 Here is the re

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-19 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-19 Thread NAKAMURA Takumi via cfe-commits
@@ -125,7 +125,7 @@ json::Array renderRegions(ArrayRef Regions) { json::Array renderBranchRegions(ArrayRef Regions) { json::Array RegionArray; for (const auto &Region : Regions) -if (!Region.Folded) +if (!Region.TrueFolded || !Region.FalseFolded) c

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-19 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/112694 >From ea3e2df8c712ae5da77e55a14e97b1b6855a6b76 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 6 Oct 2024 10:11:54 +0900 Subject: [PATCH 1/2] [Coverage] Introduce "partial fold" on BranchRegion Curren

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Alan Phipps via cfe-commits
https://github.com/evodius96 approved this pull request. https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Alan Phipps via cfe-commits
evodius96 wrote: I think this is a meaningful enhancement to branch coverage. I don't have much to add to what's been said. LGTM. Thanks! https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread NAKAMURA Takumi via cfe-commits
@@ -19,18 +19,18 @@ using namespace coverage; static void sumBranches(size_t &NumBranches, size_t &CoveredBranches, const ArrayRef &Branches) { for (const auto &BR : Branches) { -// Skip folded branches. -if (BR.Folded) - continue; - -

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Hana Dusíková via cfe-commits
hanickadot wrote: I have no additional list of thing Jessica pointed out, LGTM https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Hana Dusíková via cfe-commits
https://github.com/hanickadot approved this pull request. https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread NAKAMURA Takumi via cfe-commits
@@ -719,10 +720,10 @@ struct FunctionRecord { Region.Kind == CounterMappingRegion::MCDCBranchRegion) { CountedBranchRegions.emplace_back(Region, Count, FalseCount, HasSingleByteCoverage); - // If both counters are hard-

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni commented: Thanks for comments! https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Hana Dusíková via cfe-commits
hanickadot wrote: Do you have example before/after of the change? It's a bit hard to imagine. https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread NAKAMURA Takumi via cfe-commits
@@ -19,18 +19,18 @@ using namespace coverage; static void sumBranches(size_t &NumBranches, size_t &CoveredBranches, const ArrayRef &Branches) { for (const auto &BR : Branches) { -// Skip folded branches. -if (BR.Folded) - continue; - -

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread NAKAMURA Takumi via cfe-commits
@@ -125,7 +125,7 @@ json::Array renderRegions(ArrayRef Regions) { json::Array renderBranchRegions(ArrayRef Regions) { json::Array RegionArray; for (const auto &Region : Regions) -if (!Region.Folded) +if (!Region.TrueFolded || !Region.FalseFolded) c

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/112694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Jessica Paquette via cfe-commits
@@ -19,18 +19,18 @@ using namespace coverage; static void sumBranches(size_t &NumBranches, size_t &CoveredBranches, const ArrayRef &Branches) { for (const auto &BR : Branches) { -// Skip folded branches. -if (BR.Folded) - continue; - -

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-18 Thread Jessica Paquette via cfe-commits
@@ -125,7 +125,7 @@ json::Array renderRegions(ArrayRef Regions) { json::Array renderBranchRegions(ArrayRef Regions) { json::Array RegionArray; for (const auto &Region : Regions) -if (!Region.Folded) +if (!Region.TrueFolded || !Region.FalseFolded) o

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-17 Thread Jessica Paquette via cfe-commits
@@ -19,18 +19,18 @@ using namespace coverage; static void sumBranches(size_t &NumBranches, size_t &CoveredBranches, const ArrayRef &Branches) { for (const auto &BR : Branches) { -// Skip folded branches. -if (BR.Folded) - continue; - -

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-17 Thread Jessica Paquette via cfe-commits
@@ -719,10 +720,10 @@ struct FunctionRecord { Region.Kind == CounterMappingRegion::MCDCBranchRegion) { CountedBranchRegions.emplace_back(Region, Count, FalseCount, HasSingleByteCoverage); - // If both counters are hard-

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-17 Thread Jessica Paquette via cfe-commits
@@ -719,10 +720,10 @@ struct FunctionRecord { Region.Kind == CounterMappingRegion::MCDCBranchRegion) { CountedBranchRegions.emplace_back(Region, Count, FalseCount, HasSingleByteCoverage); - // If both counters are hard-

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-17 Thread Jessica Paquette via cfe-commits
@@ -719,10 +720,10 @@ struct FunctionRecord { Region.Kind == CounterMappingRegion::MCDCBranchRegion) { CountedBranchRegions.emplace_back(Region, Count, FalseCount, HasSingleByteCoverage); - // If both counters are hard-

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-pgo Author: NAKAMURA Takumi (chapuni) Changes Currently both True/False counts were folded. It lost the information, "It is True or False before folding." It prevented recalling branch counts in merging template instantiations. In `llvm-cov`, a folded

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: NAKAMURA Takumi (chapuni) Changes Currently both True/False counts were folded. It lost the information, "It is True or False before folding." It prevented recalling branch counts in merging template instantiations. In `llvm-cov`

[clang] [llvm] [Coverage] Introduce "partial fold" on BranchRegion (PR #112694)

2024-10-17 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/112694 Currently both True/False counts were folded. It lost the information, "It is True or False before folding." It prevented recalling branch counts in merging template instantiations. In `llvm-cov`, a folded bra