aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorPaul Kirth <paulkirth@google.com>2024-06-10 23:06:06 -0700
committerGitHub <noreply@github.com>2024-06-11 08:06:06 +0200
commit607afa0b6375e4837fef298a798f5534e783d777 (patch)
treebc96cda2dc26b207d70030af09cba3f37d402aad /llvm/lib/IR/Verifier.cpp
parent41c650e8208f7804eb5ecd8749d6b31b6e518bb7 (diff)
downloadllvm-607afa0b6375e4837fef298a798f5534e783d777.zip
llvm-607afa0b6375e4837fef298a798f5534e783d777.tar.gz
llvm-607afa0b6375e4837fef298a798f5534e783d777.tar.bz2
Revert "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (#95060)
Reverts llvm/llvm-project#86609 This change causes compile-time regressions for stage2 builds (https://llvm-compile-time-tracker.com/compare.php?from=3254f31a66263ea9647c9547f1531c3123444fcd&to=c5978f1eb5eeca8610b9dfce1fcbf1f473911cd8&stat=instructions:u). It also introduced unintended changes to `.text` which should be addressed before relanding.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index fe2253d..e592720 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -104,7 +104,6 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/IR/PassManager.h"
-#include "llvm/IR/ProfDataUtils.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Use.h"
@@ -4809,10 +4808,8 @@ void Verifier::visitProfMetadata(Instruction &I, MDNode *MD) {
// Check consistency of !prof branch_weights metadata.
if (ProfName == "branch_weights") {
- unsigned int Offset = getBranchWeightOffset(MD);
if (isa<InvokeInst>(&I)) {
- Check(MD->getNumOperands() == (1 + Offset) ||
- MD->getNumOperands() == (2 + Offset),
+ Check(MD->getNumOperands() == 2 || MD->getNumOperands() == 3,
"Wrong number of InvokeInst branch_weights operands", MD);
} else {
unsigned ExpectedNumOperands = 0;
@@ -4832,10 +4829,10 @@ void Verifier::visitProfMetadata(Instruction &I, MDNode *MD) {
CheckFailed("!prof branch_weights are not allowed for this instruction",
MD);
- Check(MD->getNumOperands() == Offset + ExpectedNumOperands,
+ Check(MD->getNumOperands() == 1 + ExpectedNumOperands,
"Wrong number of operands", MD);
}
- for (unsigned i = Offset; i < MD->getNumOperands(); ++i) {
+ for (unsigned i = 1; i < MD->getNumOperands(); ++i) {
auto &MDO = MD->getOperand(i);
Check(MDO, "second operand should not be null", MD);
Check(mdconst::dyn_extract<ConstantInt>(MDO),