Skip to content

Conversation

@abhishek-kaushik22
Copy link
Contributor

Take OperandNameToID by const& to avoid copying

 Take `OperandNameToID` by const& to avoid copying
@llvmbot
Copy link
Member

llvmbot commented Oct 22, 2025

@llvm/pr-subscribers-tablegen

Author: Abhishek Kaushik (abhishek-kaushik22)

Changes

Take OperandNameToID by const& to avoid copying


Full diff: https://github.com/llvm/llvm-project/pull/164563.diff

1 Files Affected:

  • (modified) llvm/utils/TableGen/InstrInfoEmitter.cpp (+1-1)
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index d1b14fbbdcd3e..0b90f9104208a 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -285,7 +285,7 @@ emitGetNamedOperandIdx(raw_ostream &OS,
 
 static void
 emitGetOperandIdxName(raw_ostream &OS,
-                      MapVector<StringRef, unsigned> OperandNameToID,
+                      const MapVector<StringRef, unsigned> &OperandNameToID,
                       const MapVector<SmallVector<int>, unsigned> &OperandMap,
                       unsigned MaxNumOperands, unsigned NumOperandNames) {
   OS << "LLVM_READONLY OpName getOperandIdxName(uint16_t Opcode, int16_t Idx) "

Copy link
Contributor

@ro-i ro-i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh dear, that seems to be an oversight, thanks for fixing

@abhishek-kaushik22 abhishek-kaushik22 enabled auto-merge (squash) October 22, 2025 07:07
@abhishek-kaushik22 abhishek-kaushik22 merged commit dec57c8 into llvm:main Oct 22, 2025
11 of 12 checks passed
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
)

Take `OperandNameToID` by const& to avoid copying
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
)

Take `OperandNameToID` by const& to avoid copying
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
)

Take `OperandNameToID` by const& to avoid copying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants