Skip to content

Commit c2dc46c

Browse files
committed
[TableGen] Pass ValueTypeByHwMode by const reference in a couple places. NFC
ValueTypeByHwMode contains a std::map. We shouldn't copy it if we don't need to . Fixes #101406.
1 parent 951a363 commit c2dc46c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/utils/TableGen/Common/CodeGenDAGPatterns.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ struct TypeInfer {
264264
bool MergeInTypeInfo(TypeSetByHwMode &Out, MVT::SimpleValueType InVT) const {
265265
return MergeInTypeInfo(Out, TypeSetByHwMode(InVT));
266266
}
267-
bool MergeInTypeInfo(TypeSetByHwMode &Out, ValueTypeByHwMode InVT) const {
267+
bool MergeInTypeInfo(TypeSetByHwMode &Out,
268+
const ValueTypeByHwMode &InVT) const {
268269
return MergeInTypeInfo(Out, TypeSetByHwMode(InVT));
269270
}
270271

@@ -841,7 +842,8 @@ class TreePatternNode : public RefCountedBase<TreePatternNode> {
841842
TreePattern &TP);
842843
bool UpdateNodeType(unsigned ResNo, MVT::SimpleValueType InTy,
843844
TreePattern &TP);
844-
bool UpdateNodeType(unsigned ResNo, ValueTypeByHwMode InTy, TreePattern &TP);
845+
bool UpdateNodeType(unsigned ResNo, const ValueTypeByHwMode &InTy,
846+
TreePattern &TP);
845847

846848
// Update node type with types inferred from an instruction operand or result
847849
// def from the ins/outs lists.
@@ -996,7 +998,7 @@ inline bool TreePatternNode::UpdateNodeType(unsigned ResNo,
996998
}
997999

9981000
inline bool TreePatternNode::UpdateNodeType(unsigned ResNo,
999-
ValueTypeByHwMode InTy,
1001+
const ValueTypeByHwMode &InTy,
10001002
TreePattern &TP) {
10011003
TypeSetByHwMode VTS(InTy);
10021004
TP.getInfer().expandOverloads(VTS);

0 commit comments

Comments
 (0)