Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions llvm/include/llvm/IR/CmpPredicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,7 @@ class CmpPredicate {

/// Get the swapped predicate of a CmpInst.
static CmpPredicate getSwapped(const CmpInst *Cmp);

/// Provided to facilitate storing a CmpPredicate in data structures that
/// require hashing.
friend hash_code hash_value(const CmpPredicate &Arg); // NOLINT
};

[[nodiscard]] hash_code hash_value(const CmpPredicate &Arg);
} // namespace llvm

#endif
4 changes: 0 additions & 4 deletions llvm/lib/IR/Instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3946,10 +3946,6 @@ CmpPredicate CmpPredicate::getSwapped(const CmpInst *Cmp) {
return getSwapped(get(Cmp));
}

hash_code llvm::hash_value(const CmpPredicate &Arg) { // NOLINT
return hash_combine(Arg.Pred, Arg.HasSameSign);
}

//===----------------------------------------------------------------------===//
// SwitchInst Implementation
//===----------------------------------------------------------------------===//
Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Transforms/Scalar/EarlyCSE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ static unsigned getHashValueImpl(SimpleValue Val) {
Pred = CmpInst::getInversePredicate(Pred);
std::swap(A, B);
}
return hash_combine(Inst->getOpcode(), Pred, X, Y, A, B);
return hash_combine(Inst->getOpcode(),
static_cast<CmpInst::Predicate>(Pred), X, Y, A, B);
}

if (CastInst *CI = dyn_cast<CastInst>(Inst))
Expand Down
Loading