Author: paquette
Date: Tue May 8 13:53:19 2018
New Revision: 331806
URL: http://llvm.org/viewvc/llvm-project?rev=331806&view=rev
Log:
Change -foutline to -moutline
Nitpicky, but the MachineOutliner is a machine-level pass, and so we should
reflect that by using "m" instead of "n".
Figured we sh
Author: paquette
Date: Tue May 8 13:58:32 2018
New Revision: 331810
URL: http://llvm.org/viewvc/llvm-project?rev=331810&view=rev
Log:
Add a mno-outline flag to disable the MachineOutliner
Since we're working on turning the MachineOutliner by default under -Oz for
AArch64, it makes sense to have
Author: paquette
Date: Tue Mar 26 14:22:42 2019
New Revision: 357031
URL: http://llvm.org/viewvc/llvm-project?rev=357031&view=rev
Log:
Make -mno-outline pass -enable-machine-outliner=never to ld in LTO
Since AArch64 has default outlining behaviour, we need to make sure that
-mno-outline is actual
Author: paquette
Date: Wed May 2 09:42:51 2018
New Revision: 331370
URL: http://llvm.org/viewvc/llvm-project?rev=331370&view=rev
Log:
Add -foutline option to enable the MachineOutliner in AArch64
Since we've been working on productizing the MachineOutliner in AArch64, it
makes sense to provide a
Hmm yeah, you’re right, especially considering D45916. It would be nice to have
the desired behaviour just “fall out” of that patch. I’ll write a patch adding
the flag.
- Jessica
> On May 2, 2018, at 2:48 PM, Friedman, Eli wrote:
>
> On 5/2/2018 9:42 AM, Jessica Paquette via cf
Author: paquette
Date: Mon Jun 25 10:27:51 2018
New Revision: 335503
URL: http://llvm.org/viewvc/llvm-project?rev=335503&view=rev
Log:
[MachineOutliner] Make last of -moutline/-mno-outline win
The expected behaviour of command-line flags to clang is to have
the last of -m(whatever) and -mno-(what
Author: paquette
Date: Mon Jun 25 10:36:05 2018
New Revision: 335504
URL: http://llvm.org/viewvc/llvm-project?rev=335504&view=rev
Log:
[MachineOutliner] Outline from linkonceodrs by default in LTO when -moutline is
passed
Pass -enable-linkonceodr-outlining by default when LTO is enabled.
The ou
Author: paquette
Date: Mon Jun 25 16:20:18 2018
New Revision: 335549
URL: http://llvm.org/viewvc/llvm-project?rev=335549&view=rev
Log:
[MachineOutliner] NFC - simplify -moutline/-mno-outline logic
It's a bit cleaner to use `hasFlag` instead of nested ifs. This
just refactors the -moutline/-mno-ou
Author: paquette
Date: Tue Jun 26 15:09:48 2018
New Revision: 335672
URL: http://llvm.org/viewvc/llvm-project?rev=335672&view=rev
Log:
[MachineOutliner] Emit a warning when using -moutline on unsupported targets
Instead of just saying "flag unused", we should tell the user that the
outliner isn't
Author: paquette
Date: Fri Jun 29 11:06:10 2018
New Revision: 336001
URL: http://llvm.org/viewvc/llvm-project?rev=336001&view=rev
Log:
[MachineOutliner] Make -mno-outline use -enable-machine-outliner=never
This updates -mno-outline so that it passes -enable-machine-outliner=never
instead of nothi
Author: paquette
Date: Fri Jul 6 15:24:56 2018
New Revision: 336471
URL: http://llvm.org/viewvc/llvm-project?rev=336471&view=rev
Log:
[MachineOutliner] Properly pass -moutline along to the toolchain
This moves the LTO-specific code for outlining from ToolChains/Clang.cpp to
ToolChains/Darwin.cpp
https://github.com/ornata edited https://github.com/llvm/llvm-project/pull/77214
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0,
[[@LINE]]:12 -> {{[0-9]+}}:2 =
void ternary() {
true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 ->
}
+
+// FIXME: Do not generate coverage for discarded branches in if consteval
+// GH-57377
+// CH
@@ -7732,7 +7732,11 @@ TreeTransform::TransformIfStmt(IfStmt *S) {
if (Then.isInvalid())
return StmtError();
} else {
-Then = new (getSema().Context) NullStmt(S->getThen()->getBeginLoc());
+// Discarded branch is replaced with empty CompoundStmt so we can ke
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0,
[[@LINE]]:12 -> {{[0-9]+}}:2 =
void ternary() {
true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 ->
}
+
+// FIXME: Do not generate coverage for discarded branches in if consteval
+// GH-57377
+// CH
https://github.com/ornata commented:
Added some comments, mostly nits on the test.
https://github.com/llvm/llvm-project/pull/77214
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -23,19 +23,29 @@ void foo() {// CHECK-NEXT: Gap,File 0,
[[@LINE+1]]:21 -> [[@
} // CHECK-NEXT: [[@LINE-2]]:9 -> [[@LINE-1]]:5
= #1
// CHECK-NEXT: [[@LINE-2]]:5 -> [[@LINE-2]]:8
= #1
-// FIX
@@ -7741,6 +7745,10 @@ TreeTransform::TransformIfStmt(IfStmt *S) {
Else = getDerived().TransformStmt(S->getElse());
if (Else.isInvalid())
return StmtError();
+ } else if (S->getElse() && ConstexprConditionValue &&
ornata wrote:
Could you add a c
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0,
[[@LINE]]:12 -> {{[0-9]+}}:2 =
void ternary() {
true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 ->
}
+
+// FIXME: Do not generate coverage for discarded branches in if consteval
+// GH-57377
+// CH
@@ -23,19 +23,29 @@ void foo() {// CHECK-NEXT: Gap,File 0,
[[@LINE+1]]:21 -> [[@
} // CHECK-NEXT: [[@LINE-2]]:9 -> [[@LINE-1]]:5
= #1
// CHECK-NEXT: [[@LINE-2]]:5 -> [[@LINE-2]]:8
= #1
-// FIX
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0,
[[@LINE]]:12 -> {{[0-9]+}}:2 =
void ternary() {
true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 ->
}
+
+// FIXME: Do not generate coverage for discarded branches in if consteval
+// GH-57377
+// CH
@@ -98,3 +104,49 @@ int main() {// CHECK: File 0,
[[@LINE]]:12 -> {{[0-9]+}}:2 =
void ternary() {
true ? FOO : FOO; // CHECK-NOT: Gap,{{.*}}, [[@LINE]]:8 ->
}
+
+// FIXME: Do not generate coverage for discarded branches in if consteval
+// GH-57377
+// CH
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?=
Message-ID:
In-Reply-To:
ornata wrote:
LGTM
https://github.com/llvm/llvm-project/pull/77214
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?=
Message-ID:
In-Reply-To:
https://github.com/ornata approved this pull request.
https://github.com/llvm/llvm-project/pull/77214
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-b
@@ -308,13 +309,21 @@ Error
RawCoverageMappingReader::readMappingRegionsSubArray(
return Err;
if (auto Err = readIntMax(FID, std::numeric_limits::max()))
return Err;
+ if (ID == 0)
+return make_error(
+cove
ornata wrote:
Is the main benefit of this avoiding zero initialization?
https://github.com/llvm/llvm-project/pull/81227
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ornata approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/81227
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ornata approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/81459
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,33 @@
+//=== MCDCState.h - MC/DC-related types for PGO -*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
Hana =?utf-8?q?Dusíková?=
Message-ID:
In-Reply-To:
ornata wrote:
I think that skipping whitespace-only regions in llvm-cov intuitively makes
sense. In general, showing coverage information about empty spaces doesn't give
the user any useful information.
I think I'd do that part in a separ
@@ -746,21 +781,52 @@ struct MCDCCoverageBuilder {
// assign that ID to its LHS node. Its RHS will receive a new ID.
if (CondIDs.contains(CodeGenFunction::stripCond(E))) {
// If Stmt has an ID, assign its ID to LHS
- CondIDs[CodeGenFunction::stripCond(E->get
@@ -722,6 +739,24 @@ struct MCDCCoverageBuilder {
return I->second;
}
+ /// Return the ID of the next condition when the given condition is True.
+ MCDCConditionID getNextIfTrueCondID(const Expr *Cond) const {
+auto I = TrueCondIDs.find(CodeGenFunction::stripCond
@@ -298,7 +298,7 @@ struct CounterMappingRegion {
unsigned ExpandedFileID, unsigned LineStart,
unsigned ColumnStart, unsigned LineEnd,
unsigned ColumnEnd, RegionKind Kind)
- : MCDCParams(MCDCParams), Expa
@@ -722,6 +709,12 @@ struct MCDCCoverageBuilder {
return I->second;
}
+ /// Return the LHS Decision ({0,0} if not set).
+ const DecisionIDPair &back() {
+assert(DecisionStack.size() >= 1);
ornata wrote:
This assert should be unnecessary. `SmallV
@@ -676,41 +679,25 @@ struct MCDCCoverageBuilder {
return E->getOpcode() == BO_LAnd;
}
- /// Push an ID onto the corresponding RHS stack.
- void pushRHS(const BinaryOperator *E) {
-llvm::SmallVector &rhs = isLAnd(E) ? AndRHS : OrRHS;
-rhs.push_back(CondIDs[Code
@@ -676,41 +679,25 @@ struct MCDCCoverageBuilder {
return E->getOpcode() == BO_LAnd;
}
- /// Push an ID onto the corresponding RHS stack.
- void pushRHS(const BinaryOperator *E) {
-llvm::SmallVector &rhs = isLAnd(E) ? AndRHS : OrRHS;
-rhs.push_back(CondIDs[Code
@@ -676,41 +679,25 @@ struct MCDCCoverageBuilder {
return E->getOpcode() == BO_LAnd;
}
- /// Push an ID onto the corresponding RHS stack.
- void pushRHS(const BinaryOperator *E) {
-llvm::SmallVector &rhs = isLAnd(E) ? AndRHS : OrRHS;
-rhs.push_back(CondIDs[Code
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?=
Message-ID:
In-Reply-To:
@@ -1700,43 +1776,116 @@ struct CounterCoverageMappingBuilder
Visit(S->getSubStmt());
}
+ void CoverIfConsteval(const IfStmt *S) {
ornata
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?=
Message-ID:
In-Reply-To:
@@ -1700,43 +1776,116 @@ struct CounterCoverageMappingBuilder
Visit(S->getSubStmt());
}
+ void CoverIfConsteval(const IfStmt *S) {
+assert(S->isConste
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?=
Message-ID:
In-Reply-To:
@@ -1251,6 +1264,69 @@ struct CounterCoverageMappingBuilder
popRegions(Index);
}
+ /// Find a valid range starting with \p S
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?= ,
Hana =?utf-8?q?Dusíková?=
Message-ID:
In-Reply-To:
@@ -174,6 +179,10 @@ class SourceMappingRegion {
void setGap(bool Gap) { GapRegion = Gap; }
+ boo
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= ,
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= ,
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= ,
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?= ,
Hana =?utf-8?q?Dusi=CC=81kova=CC=81?=
Message-ID:
In-Reply-To:
https://github.com/ornata approved this pull request.
LGTM
https://git
Author: Jessica Paquette
Date: 2023-04-27T14:51:38-07:00
New Revision: 17cfd2e025cb3aa929ad219c6ed0974d6198bf5b
URL:
https://github.com/llvm/llvm-project/commit/17cfd2e025cb3aa929ad219c6ed0974d6198bf5b
DIFF:
https://github.com/llvm/llvm-project/commit/17cfd2e025cb3aa929ad219c6ed0974d6198bf5b.di
https://github.com/ornata approved this pull request.
https://github.com/llvm/llvm-project/pull/81257
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -983,7 +979,7 @@ void CodeGenPGO::mapRegionCounters(const Decl *D) {
// for most embedded applications. Setting a maximum value prevents the
// bitmap footprint from growing too large without the user's knowledge. In
// the future, this value could be adjusted with a c
@@ -484,10 +484,31 @@ MC/DC Instrumentation
-
When instrumenting for Modified Condition/Decision Coverage (MC/DC) using the
-clang option ``-fcoverage-mcdc``, users are limited to at most **six**
leaf-level
-conditions in a boolean expression. A warning w
https://github.com/ornata edited https://github.com/llvm/llvm-project/pull/82448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ornata commented:
Some nits on documentation wording. Code looks fine to me.
https://github.com/llvm/llvm-project/pull/82448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-
@@ -484,10 +484,31 @@ MC/DC Instrumentation
-
When instrumenting for Modified Condition/Decision Coverage (MC/DC) using the
-clang option ``-fcoverage-mcdc``, users are limited to at most **six**
leaf-level
-conditions in a boolean expression. A warning w
@@ -484,10 +484,31 @@ MC/DC Instrumentation
-
When instrumenting for Modified Condition/Decision Coverage (MC/DC) using the
-clang option ``-fcoverage-mcdc``, users are limited to at most **six**
leaf-level
-conditions in a boolean expression. A warning w
https://github.com/ornata approved this pull request.
https://github.com/llvm/llvm-project/pull/82448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -190,18 +190,30 @@ class SourceMappingRegion {
bool isBranch() const { return FalseCount.has_value(); }
+ bool isMCDCBranch() const {
+const auto *BranchParams =
std::get_if(&MCDCParams);
+assert(BranchParams == nullptr || BranchParams->ID >= 0);
--
@@ -190,18 +190,30 @@ class SourceMappingRegion {
bool isBranch() const { return FalseCount.has_value(); }
+ bool isMCDCBranch() const {
+const auto *BranchParams =
std::get_if(&MCDCParams);
+assert(BranchParams == nullptr || BranchParams->ID >= 0);
+return (B
@@ -2050,23 +2069,74 @@ struct CounterCoverageMappingBuilder
subtractCounters(ParentCount, TrueCount));
}
- void createDecision(const BinaryOperator *E) {
+ void createOrCancelDecision(const BinaryOperator *E, unsigned Since) {
unsigned NumCon
@@ -983,7 +979,7 @@ void CodeGenPGO::mapRegionCounters(const Decl *D) {
// for most embedded applications. Setting a maximum value prevents the
// bitmap footprint from growing too large without the user's knowledge. In
// the future, this value could be adjusted with a c
https://github.com/ornata approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/97952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -517,7 +552,7 @@ class CoverageMappingBuilder {
SourceRegionFilter Filter;
for (const auto &FM : FileIDMapping) {
SourceLocation ExpandedLoc = FM.second.second;
- SourceLocation ParentLoc = getIncludeOrExpansionLoc(ExpandedLoc);
+ SourceLocation Paren
@@ -2064,7 +2082,20 @@ struct CounterCoverageMappingBuilder
createDecisionRegion(E, DecisionParams);
}
+ /// Check if E belongs to system headers.
+ bool isExprInSystemHeader(const BinaryOperator *E) const {
ornata wrote:
assert E is not nullptr?
htt
@@ -190,6 +190,16 @@ class SourceMappingRegion {
bool isBranch() const { return FalseCount.has_value(); }
+ bool isMCDCBranch() const {
+const auto *BranchParams =
std::get_if(&MCDCParams);
+assert(BranchParams == nullptr || BranchParams->ID >= 0);
+return (Br
https://github.com/ornata approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/91446
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -517,7 +552,7 @@ class CoverageMappingBuilder {
SourceRegionFilter Filter;
for (const auto &FM : FileIDMapping) {
SourceLocation ExpandedLoc = FM.second.second;
- SourceLocation ParentLoc = getIncludeOrExpansionLoc(ExpandedLoc);
+ SourceLocation Paren
https://github.com/ornata approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/89572
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Jessica Paquette
Date: 2021-09-03T10:28:07-07:00
New Revision: b9e57e030560fef9ddc51caca8bacfefccdf8a62
URL:
https://github.com/llvm/llvm-project/commit/b9e57e030560fef9ddc51caca8bacfefccdf8a62
DIFF:
https://github.com/llvm/llvm-project/commit/b9e57e030560fef9ddc51caca8bacfefccdf8a62.di
@@ -719,10 +720,10 @@ struct FunctionRecord {
Region.Kind == CounterMappingRegion::MCDCBranchRegion) {
CountedBranchRegions.emplace_back(Region, Count, FalseCount,
HasSingleByteCoverage);
- // If both counters are hard-
@@ -719,10 +720,10 @@ struct FunctionRecord {
Region.Kind == CounterMappingRegion::MCDCBranchRegion) {
CountedBranchRegions.emplace_back(Region, Count, FalseCount,
HasSingleByteCoverage);
- // If both counters are hard-
@@ -719,10 +720,10 @@ struct FunctionRecord {
Region.Kind == CounterMappingRegion::MCDCBranchRegion) {
CountedBranchRegions.emplace_back(Region, Count, FalseCount,
HasSingleByteCoverage);
- // If both counters are hard-
@@ -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;
-
-
@@ -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
@@ -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;
-
-
@@ -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);
+
@@ -1709,6 +1730,13 @@ struct CounterCoverageMappingBuilder
: addCounters(
addCounters(ParentCount, BackedgeCount,
BodyBC.ContinueCount),
IncrementBC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSingle
@@ -1804,9 +1832,10 @@ struct CounterCoverageMappingBuilder
Counter LoopCount =
addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
-Counter OutCount =
-addCounters(BC.BreakCount, subtractCounters(LoopCount, BodyCount));
-if (OutCount != Pare
@@ -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
@@ -941,6 +941,19 @@ struct CounterCoverageMappingBuilder
return Counter::getCounter(CounterMap[S]);
}
+ std::pair getBranchCounterPair(const Stmt *S,
+ Counter ParentCnt) {
+Counter ExecCnt = getRegionCounter(S);
+
@@ -1645,22 +1662,26 @@ struct CounterCoverageMappingBuilder
Counter CondCount = llvm::EnableSingleByteCoverage
? getRegionCounter(S->getCond())
: addCounters(BackedgeCount, BC.ContinueCount);
+auto [ExecCount, Exi
@@ -1709,6 +1730,13 @@ struct CounterCoverageMappingBuilder
: addCounters(
addCounters(ParentCount, BackedgeCount,
BodyBC.ContinueCount),
IncrementBC.ContinueCount);
+auto [ExecCount, ExitCount] =
+(llvm::EnableSingle
@@ -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 {
ornata wrote:
A doxygen comment here might be useful.
https://github.com/llvm/llvm-project/pull/112702
@@ -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:
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;
+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) {
---
@@ -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
@@ -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/ornata approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/125404
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -30,8 +32,20 @@ struct State {
unsigned BitmapBits = 0;
struct Decision {
+using IndicesTy = llvm::SmallVector>;
+static constexpr auto InvalidID = std::numeric_limits::max();
+
unsigned BitmapIdx;
-llvm::SmallVector> Indices;
+IndicesTy Indices;
+
@@ -30,8 +32,20 @@ struct State {
unsigned BitmapBits = 0;
struct Decision {
+using IndicesTy = llvm::SmallVector>;
+static constexpr auto InvalidID = std::numeric_limits::max();
+
unsigned BitmapIdx;
-llvm::SmallVector> Indices;
+IndicesTy Indices;
+
ornata wrote:
Can you explain why we want to use yaml2obj for testcases in the commit message?
https://github.com/llvm/llvm-project/pull/113114
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-
@@ -1869,7 +1871,10 @@ void CodeGenFunction::EmitAutoVarInit(const
AutoVarEmission &emission) {
// If we are at an unreachable point, we don't need to emit the initializer
// unless it contains a label.
if (!HaveInsertPoint()) {
-if (!Init || !ContainsLabel(Init)) re
@@ -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
@@ -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
@@ -1804,9 +1832,10 @@ struct CounterCoverageMappingBuilder
Counter LoopCount =
addCounters(ParentCount, BackedgeCount, BC.ContinueCount);
-Counter OutCount =
-addCounters(BC.BreakCount, subtractCounters(LoopCount, BodyCount));
-if (OutCount != Pare
@@ -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
@@ -362,6 +362,8 @@ CodeGenFunction::AddInitializerToStaticVarDecl(const
VarDecl &D,
return GV;
}
+ PGO.markStmtMaybeUsed(D.getInit()); // FIXME: Too lazy
ornata wrote:
Too lazy?
https://github.com/llvm/llvm-project/pull/112724
__
https://github.com/ornata approved this pull request.
I don't see any problem with this change.
https://github.com/llvm/llvm-project/pull/113114
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
1 - 100 of 105 matches
Mail list logo