[llvm] [TableGen] Extend direct lookup to instruction values in generic tables. (PR #80486)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 16:50:28 PST 2024
================
@@ -538,6 +538,13 @@ void CodeGenTarget::ComputeInstrsByEnum() const {
return std::make_tuple(!D1.getValueAsBit("isPseudo"), D1.getName()) <
std::make_tuple(!D2.getValueAsBit("isPseudo"), D2.getName());
});
+
+ // Build the instruction-to-int map using the same values emitted by
+ // InstrInfoEmitter::emitEnums.
+ assert(InstrToIntMap.empty());
+ unsigned Num = 0;
+ for (const CodeGenInstruction *Inst : InstrsByEnum)
----------------
topperc wrote:
Sorry I'm late to this, but why not make this a field of CodeGenInstruction? We already have a map from Record to CodeGenInstruction.
https://github.com/llvm/llvm-project/pull/80486
More information about the llvm-commits
mailing list