Skip to content

Conversation

@evodius96
Copy link
Contributor

Reverts #144335

Need to resolve test failures

@llvmbot llvmbot added the PGO Profile Guided Optimizations label Jun 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 18, 2025

@llvm/pr-subscribers-pgo

Author: Alan Phipps (evodius96)

Changes

Reverts llvm/llvm-project#144335

Need to resolve test failures


Full diff: https://github.com/llvm/llvm-project/pull/144783.diff

2 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h (-12)
  • (modified) llvm/tools/llvm-cov/CoverageExporterJson.cpp (+2-4)
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
index 8e6180be25b51..d1230b0ba7c58 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
@@ -31,7 +31,6 @@
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/raw_ostream.h"
-#include <algorithm>
 #include <cassert>
 #include <cstdint>
 #include <iterator>
@@ -495,17 +494,6 @@ struct MCDCRecord {
     return TV[TestVectorIndex].first[PosToID[Condition]];
   }
 
-  /// Return the number of True and False decisions for all executed test
-  /// vectors.
-  std::pair<unsigned, unsigned> getDecisions() const {
-    const unsigned TrueDecisions =
-        std::count_if(TV.begin(), TV.end(), [](const auto &TestVec) {
-          return TestVec.second == CondState::MCDC_True;
-        });
-
-    return {TrueDecisions, TV.size() - TrueDecisions};
-  }
-
   /// Return the Result evaluation for an executed test vector.
   /// See MCDCRecordProcessor::RecordTestVector().
   CondState getTVResult(unsigned TestVectorIndex) {
diff --git a/llvm/tools/llvm-cov/CoverageExporterJson.cpp b/llvm/tools/llvm-cov/CoverageExporterJson.cpp
index 024693a24cc23..4088c1b053aa8 100644
--- a/llvm/tools/llvm-cov/CoverageExporterJson.cpp
+++ b/llvm/tools/llvm-cov/CoverageExporterJson.cpp
@@ -62,7 +62,7 @@
 #include <utility>
 
 /// The semantic version combined as a string.
-#define LLVM_COVERAGE_EXPORT_JSON_STR "3.0.0"
+#define LLVM_COVERAGE_EXPORT_JSON_STR "2.0.1"
 
 /// Unique type identifier for JSON coverage export.
 #define LLVM_COVERAGE_EXPORT_JSON_TYPE_STR "llvm.coverage.json.export"
@@ -110,10 +110,8 @@ json::Array gatherConditions(const coverage::MCDCRecord &Record) {
 
 json::Array renderMCDCRecord(const coverage::MCDCRecord &Record) {
   const llvm::coverage::CounterMappingRegion &CMR = Record.getDecisionRegion();
-  const auto [TrueDecisions, FalseDecisions] = Record.getDecisions();
   return json::Array({CMR.LineStart, CMR.ColumnStart, CMR.LineEnd,
-                      CMR.ColumnEnd, TrueDecisions, FalseDecisions,
-                      CMR.ExpandedFileID, int64_t(CMR.Kind),
+                      CMR.ColumnEnd, CMR.ExpandedFileID, int64_t(CMR.Kind),
                       gatherConditions(Record)});
 }
 

Copy link
Contributor

@jplehr jplehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG
thanks for quick revert

@evodius96 evodius96 merged commit 88d2507 into main Jun 18, 2025
7 of 9 checks passed
@evodius96 evodius96 deleted the revert-144335-export_decision_coverage_to_json branch June 18, 2025 19:34
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PGO Profile Guided Optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants