Skip to content

Commit a3e0d72

Browse files
committed
Fix layering violation
Suggested at <#148758 (comment)>.
1 parent 92ddaa0 commit a3e0d72

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

llvm/include/llvm/IR/ProfDataUtils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ struct MDProfLabels {
3030
LLVM_ABI static const char *UnknownBranchWeightsMarker;
3131
};
3232

33+
/// Profile-based loop metadata that should be accessed only by using
34+
/// \c llvm::getLoopEstimatedTripCount and \c llvm::setLoopEstimatedTripCount.
35+
LLVM_ABI extern const char *LLVMLoopEstimatedTripCount;
36+
3337
/// Checks if an Instruction has MD_prof Metadata
3438
LLVM_ABI bool hasProfMD(const Instruction &I);
3539

llvm/include/llvm/Transforms/Utils/LoopUtils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ typedef std::pair<const RuntimeCheckingPtrGroup *,
5252
template <typename T, unsigned N> class SmallSetVector;
5353
template <typename T, unsigned N> class SmallPriorityWorklist;
5454

55-
const char *const LLVMLoopEstimatedTripCount = "llvm.loop.estimated_trip_count";
56-
5755
LLVM_ABI BasicBlock *InsertPreheaderForLoop(Loop *L, DominatorTree *DT,
5856
LoopInfo *LI,
5957
MemorySSAUpdater *MSSAU,

llvm/lib/IR/ProfDataUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const char *MDProfLabels::FunctionEntryCount = "function_entry_count";
9595
const char *MDProfLabels::SyntheticFunctionEntryCount =
9696
"synthetic_function_entry_count";
9797
const char *MDProfLabels::UnknownBranchWeightsMarker = "unknown";
98+
const char *LLVMLoopEstimatedTripCount = "llvm.loop.estimated_trip_count";
9899

99100
bool hasProfMD(const Instruction &I) {
100101
return I.hasMetadata(LLVMContext::MD_prof);

llvm/lib/IR/Verifier.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@
121121
#include "llvm/Support/MathExtras.h"
122122
#include "llvm/Support/ModRef.h"
123123
#include "llvm/Support/raw_ostream.h"
124-
#include "llvm/Transforms/Utils/LoopUtils.h"
125124
#include <algorithm>
126125
#include <cassert>
127126
#include <cstdint>

0 commit comments

Comments
 (0)