aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2025-06-07 09:31:42 +0100
committerGitHub <noreply@github.com>2025-06-07 09:31:42 +0100
commitbb9dcb27df133dd3788e7dfcd2bf31382673a2bc (patch)
treed996b402feeb049c521d5be9b0dc9160f31c278f /llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
parenteec9431d37e22a627c78e2f345d41a9a40e0c1c0 (diff)
downloadllvm-bb9dcb27df133dd3788e7dfcd2bf31382673a2bc.zip
llvm-bb9dcb27df133dd3788e7dfcd2bf31382673a2bc.tar.gz
llvm-bb9dcb27df133dd3788e7dfcd2bf31382673a2bc.tar.bz2
[TableGen] Use `contains` instead of `count`. NFC. (#143156)
Diffstat (limited to 'llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index 3029604..2de2ecc 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -730,8 +730,8 @@ bool TypeInfer::EnforceSameNumElts(TypeSetByHwMode &V, TypeSetByHwMode &W) {
// processed identically.
auto NoLength = [](const SmallDenseSet<ElementCount> &Lengths,
MVT T) -> bool {
- return !Lengths.count(T.isVector() ? T.getVectorElementCount()
- : ElementCount());
+ return !Lengths.contains(T.isVector() ? T.getVectorElementCount()
+ : ElementCount());
};
SmallVector<unsigned, 4> Modes;
@@ -778,7 +778,7 @@ bool TypeInfer::EnforceSameSize(TypeSetByHwMode &A, TypeSetByHwMode &B) {
typedef SmallSet<TypeSize, 2, TypeSizeComparator> TypeSizeSet;
auto NoSize = [](const TypeSizeSet &Sizes, MVT T) -> bool {
- return !Sizes.count(T.getSizeInBits());
+ return !Sizes.contains(T.getSizeInBits());
};
SmallVector<unsigned, 4> Modes;
@@ -3331,7 +3331,7 @@ void CodeGenDAGPatterns::ParsePatternFragments(bool OutFrags) {
auto ArgsCopy = Args;
SmallDenseSet<StringRef, 4> OperandsSet(llvm::from_range, ArgsCopy);
- if (OperandsSet.count(""))
+ if (OperandsSet.contains(""))
P->error("Cannot have unnamed 'node' values in pattern fragment!");
// Parse the operands list.