diff options
author | Mircea Trofin <mtrofin@google.com> | 2025-06-25 16:20:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-25 16:20:10 -0700 |
commit | 82cbd68504e6206ec40a5b41ea14aa6a4988e6fe (patch) | |
tree | 5fef864cbf8b6f63f1e4767b66f39c55803be554 /llvm/lib/IR/Verifier.cpp | |
parent | 00f6d6ab66a7c7caf74562eea442653919a79dd9 (diff) | |
download | llvm-82cbd68504e6206ec40a5b41ea14aa6a4988e6fe.zip llvm-82cbd68504e6206ec40a5b41ea14aa6a4988e6fe.tar.gz llvm-82cbd68504e6206ec40a5b41ea14aa6a4988e6fe.tar.bz2 |
[NFC][PGO] Use constants rather than free strings for metadata labels (#145721)
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index e7bb6d9..9cab88b 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -2536,8 +2536,8 @@ void Verifier::verifyFunctionMetadata( "expected string with name of the !prof annotation", MD); MDString *MDS = cast<MDString>(MD->getOperand(0)); StringRef ProfName = MDS->getString(); - Check(ProfName == "function_entry_count" || - ProfName == "synthetic_function_entry_count", + Check(ProfName == MDProfLabels::FunctionEntryCount || + ProfName == MDProfLabels::SyntheticFunctionEntryCount, "first operand should be 'function_entry_count'" " or 'synthetic_function_entry_count'", MD); @@ -4993,7 +4993,7 @@ void Verifier::visitProfMetadata(Instruction &I, MDNode *MD) { StringRef ProfName = MDS->getString(); // Check consistency of !prof branch_weights metadata. - if (ProfName == "branch_weights") { + if (ProfName == MDProfLabels::BranchWeights) { unsigned NumBranchWeights = getNumBranchWeights(*MD); if (isa<InvokeInst>(&I)) { Check(NumBranchWeights == 1 || NumBranchWeights == 2, @@ -5027,8 +5027,8 @@ void Verifier::visitProfMetadata(Instruction &I, MDNode *MD) { "!prof brunch_weights operand is not a const int"); } } else { - Check(ProfName == "VP", "expected either branch_weights or VP profile name", - MD); + Check(ProfName == MDProfLabels::ValueProfile, + "expected either branch_weights or VP profile name", MD); } } |