https://github.com/chapuni edited
https://github.com/llvm/llvm-project/pull/112702
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/chapuni closed
https://github.com/llvm/llvm-project/pull/112702
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/chapuni updated
https://github.com/llvm/llvm-project/pull/112702
>From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi
Date: Wed, 16 Oct 2024 23:16:53 +0900
Subject: [PATCH 01/12] [Coverage] Introduce `getBranchCounterPair()`. NFC.
Thi
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
ornata wrote:
Ok, annotating the members sounds fine to me.
https://github.com/llvm/llvm-project/pull/112702
__
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
+Counter Executed;
+Counter Skipped;
+ };
+
+ BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
---
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
https://github.com/chapuni updated
https://github.com/llvm/llvm-project/pull/112702
>From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi
Date: Wed, 16 Oct 2024 23:16:53 +0900
Subject: [PATCH 01/11] [Coverage] Introduce `getBranchCounterPair()`. NFC.
Thi
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
chapuni wrote:
`BranchCounterPair` is a local type and only `getBranchCounterPair()` emits it
for now. I think it'd be
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
+Counter Executed;
+Counter Skipped;
+ };
+
+ BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+Co
@@ -1592,6 +1605,13 @@ struct CounterCoverageMappingBuilder
llvm::EnableSingleByteCoverage
? getRegionCounter(S->getCond())
: addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSing
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
chapuni wrote:
I wrote similar comments (from codegen side) in #112724 and I wanted to leave
this side self-descriptive
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
+Counter Executed;
chapuni wrote:
I still wonder which pair of names would fit best. I adopted "Exec" from
`BinOp`
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
@@ -939,8 +939,17 @@ struct CounterCoverageMappingBuilder
Counter Skipped;
};
- BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+ BranchCounterPair
+ getBranchCounterPair(const Stmt *S, Counter ParentCnt,
+ std::optiona
https://github.com/chapuni updated
https://github.com/llvm/llvm-project/pull/112702
>From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi
Date: Wed, 16 Oct 2024 23:16:53 +0900
Subject: [PATCH 1/9] [Coverage] Introduce `getBranchCounterPair()`. NFC.
This
@@ -1592,6 +1605,13 @@ struct CounterCoverageMappingBuilder
llvm::EnableSingleByteCoverage
? getRegionCounter(S->getCond())
: addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSing
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
+ Counter ParentCnt) {
+Counter ExecCnt = getRegionCounter(S);
+
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
+Counter Executed;
+Counter Skipped;
+ };
+
+ BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
+Co
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
+Counter Executed;
+Counter Skipped;
+ };
+
+ BranchCounterPair getBranchCounterPair(const Stmt *S, Counter ParentCnt) {
---
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
ornata wrote:
IIUC the point of this pair is given:
```
if (x) {
// ... do something
} else if (y) {
// ... somethin
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
+Counter Executed;
ornata wrote:
Comments on member variables?
E.g.
```
/// Counter tracking number of times the b
@@ -938,6 +938,37 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ struct BranchCounterPair {
ornata wrote:
A doxygen comment here might be useful.
https://github.com/llvm/llvm-project/pull/112702
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
chapuni wrote:
Done but I am still dubious namings would be appropriate. Not all users expect
`[Exec
https://github.com/chapuni updated
https://github.com/llvm/llvm-project/pull/112702
>From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi
Date: Wed, 16 Oct 2024 23:16:53 +0900
Subject: [PATCH 1/5] [Coverage] Introduce `getBranchCounterPair()`. NFC.
This
https://github.com/chapuni updated
https://github.com/llvm/llvm-project/pull/112702
>From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi
Date: Wed, 16 Oct 2024 23:16:53 +0900
Subject: [PATCH 1/4] [Coverage] Introduce `getBranchCounterPair()`. NFC.
This
@@ -2221,27 +2249,27 @@ struct CounterCoverageMappingBuilder
extendRegion(E->getRHS());
propagateCounts(getRegionCounter(E), E->getRHS());
+if (llvm::EnableSingleByteCoverage)
chapuni wrote:
This is a small refactor for below and this itself will
@@ -1592,6 +1605,13 @@ struct CounterCoverageMappingBuilder
llvm::EnableSingleByteCoverage
? getRegionCounter(S->getCond())
: addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSing
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
+ Counter ParentCnt) {
+Counter ExecCnt = getRegionCounter(S);
+
@@ -2221,27 +2249,27 @@ struct CounterCoverageMappingBuilder
extendRegion(E->getRHS());
propagateCounts(getRegionCounter(E), E->getRHS());
+if (llvm::EnableSingleByteCoverage)
ornata wrote:
I think that in the future, it would be really useful to
@@ -1804,9 +1832,10 @@ struct CounterCoverageMappingBuilder
Counter LoopCount =
addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
-Counter OutCount =
-addCounters(BC.BreakCount, subtractCounters(LoopCount, BodyCount));
-if (OutCount != Pare
@@ -1709,6 +1730,13 @@ struct CounterCoverageMappingBuilder
: addCounters(
addCounters(ParentCount, BackedgeCount,
BodyBC.ContinueCount),
IncrementBC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSingle
@@ -1592,6 +1605,13 @@ struct CounterCoverageMappingBuilder
llvm::EnableSingleByteCoverage
? getRegionCounter(S->getCond())
: addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSing
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
+ Counter ParentCnt) {
+Counter ExecCnt = getRegionCounter(S);
+
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
ornata wrote:
I think changing the name is sufficient for making me less confused
https://github.com
https://github.com/chapuni updated
https://github.com/llvm/llvm-project/pull/112702
>From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi
Date: Wed, 16 Oct 2024 23:16:53 +0900
Subject: [PATCH 1/3] [Coverage] Introduce `getBranchCounterPair()`. NFC.
This
chapuni wrote:
@ornata I put #113115 as the final form. HTH
https://github.com/llvm/llvm-project/pull/112702
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1709,6 +1730,13 @@ struct CounterCoverageMappingBuilder
: addCounters(
addCounters(ParentCount, BackedgeCount,
BodyBC.ContinueCount),
IncrementBC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSingle
@@ -1645,22 +1662,26 @@ struct CounterCoverageMappingBuilder
Counter CondCount = llvm::EnableSingleByteCoverage
? getRegionCounter(S->getCond())
: addCounters(BackedgeCount, BC.ContinueCount);
+auto [ExecCount, Exi
@@ -1804,9 +1832,10 @@ struct CounterCoverageMappingBuilder
Counter LoopCount =
addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
-Counter OutCount =
-addCounters(BC.BreakCount, subtractCounters(LoopCount, BodyCount));
-if (OutCount != Pare
@@ -1709,6 +1730,13 @@ struct CounterCoverageMappingBuilder
: addCounters(
addCounters(ParentCount, BackedgeCount,
BodyBC.ContinueCount),
IncrementBC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSingle
@@ -1592,6 +1605,13 @@ struct CounterCoverageMappingBuilder
llvm::EnableSingleByteCoverage
? getRegionCounter(S->getCond())
: addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSing
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
+ Counter ParentCnt) {
+Counter ExecCnt = getRegionCounter(S);
+
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
+ Counter ParentCnt) {
+Counter ExecCnt = getRegionCounter(S);
+
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
ornata wrote:
it's not immediately obvious what the pair represents from this function name.
`getExe
https://github.com/chapuni updated
https://github.com/llvm/llvm-project/pull/112702
>From fc697f04fd6c9f3c217ce04e3f1dd082c1f1a705 Mon Sep 17 00:00:00 2001
From: NAKAMURA Takumi
Date: Wed, 16 Oct 2024 23:16:53 +0900
Subject: [PATCH 1/2] [Coverage] Introduce `getBranchCounterPair()`. NFC.
This
llvmbot wrote:
@llvm/pr-subscribers-clang-codegen
@llvm/pr-subscribers-clang
Author: NAKAMURA Takumi (chapuni)
Changes
This aggregates the generation of branch counter pair as `ExecCnt` and
`SkipCnt`, to aggregate `CounterExpr::subtract`. At the moment:
- This change preserves the behavi
https://github.com/chapuni created
https://github.com/llvm/llvm-project/pull/112702
This aggregates the generation of branch counter pair as `ExecCnt` and
`SkipCnt`, to aggregate `CounterExpr::subtract`. At the moment:
- This change preserves the behavior of `llvm::EnableSingleByteCoverage`.
53 matches
Mail list logo