[llvm-branch-commits] [llvm] [NFC][IR2Vec] Minor refactoring of opcode access in vocabulary (PR #147585)
Aiden Grossman via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jul 10 11:11:06 PDT 2025
================
@@ -447,21 +453,18 @@ void IR2VecVocabAnalysis::generateNumMappedVocab() {
// Handle Opcodes
std::vector<Embedding> NumericOpcodeEmbeddings(Vocabulary::MaxOpcodes,
Embedding(Dim, 0));
-#define HANDLE_INST(NUM, OPCODE, CLASS) \
- { \
- auto It = OpcVocab.find(#OPCODE); \
- if (It != OpcVocab.end()) \
- NumericOpcodeEmbeddings[NUM - 1] = It->second; \
- else \
- handleMissingEntity(#OPCODE); \
+ for (unsigned Opcode : seq(0u, Vocabulary::MaxOpcodes)) {
----------------
boomanaiden154 wrote:
Interesting.
https://github.com/llvm/llvm-project/pull/147585
More information about the llvm-branch-commits
mailing list