aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenSchedule.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-07-26 19:03:47 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-07-26 19:04:23 +0000
commit7fa27ce4a07f19b07799a767fc29416f3b625afb (patch)
tree27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/utils/TableGen/CodeGenSchedule.cpp
parente3b557809604d036af6e00c60f012c2025b59a5e (diff)
Diffstat (limited to 'llvm/utils/TableGen/CodeGenSchedule.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenSchedule.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/utils/TableGen/CodeGenSchedule.cpp b/llvm/utils/TableGen/CodeGenSchedule.cpp
index 441a088c1731..04219a6e54d9 100644
--- a/llvm/utils/TableGen/CodeGenSchedule.cpp
+++ b/llvm/utils/TableGen/CodeGenSchedule.cpp
@@ -298,12 +298,12 @@ processSTIPredicate(STIPredicateFunction &Fn,
RecVec Classes = Def->getValueAsListOfDefs("Classes");
for (const Record *EC : Classes) {
const Record *Pred = EC->getValueAsDef("Predicate");
- if (Predicate2Index.find(Pred) == Predicate2Index.end())
+ if (!Predicate2Index.contains(Pred))
Predicate2Index[Pred] = NumUniquePredicates++;
RecVec Opcodes = EC->getValueAsListOfDefs("Opcodes");
for (const Record *Opcode : Opcodes) {
- if (Opcode2Index.find(Opcode) == Opcode2Index.end()) {
+ if (!Opcode2Index.contains(Opcode)) {
Opcode2Index[Opcode] = OpcodeMappings.size();
OpcodeMappings.emplace_back(Opcode, OpcodeInfo());
}
@@ -370,11 +370,11 @@ processSTIPredicate(STIPredicateFunction &Fn,
const std::pair<APInt, APInt> &RhsMasks = OpcodeMasks[RhsIdx];
auto LessThan = [](const APInt &Lhs, const APInt &Rhs) {
- unsigned LhsCountPopulation = Lhs.countPopulation();
- unsigned RhsCountPopulation = Rhs.countPopulation();
+ unsigned LhsCountPopulation = Lhs.popcount();
+ unsigned RhsCountPopulation = Rhs.popcount();
return ((LhsCountPopulation < RhsCountPopulation) ||
((LhsCountPopulation == RhsCountPopulation) &&
- (Lhs.countLeadingZeros() > Rhs.countLeadingZeros())));
+ (Lhs.countl_zero() > Rhs.countl_zero())));
};
if (LhsMasks.first != RhsMasks.first)