[llvm] 9a93de5 - [TableGen] Simplify copying OperandMap entries for tied operands in CompressInstEmitter. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 27 14:59:20 PDT 2025
Author: Craig Topper
Date: 2025-06-27T14:58:53-07:00
New Revision: 9a93de58f7f3670d106a9910976e967564b6883d
URL: https://github.com/llvm/llvm-project/commit/9a93de58f7f3670d106a9910976e967564b6883d
DIFF: https://github.com/llvm/llvm-project/commit/9a93de58f7f3670d106a9910976e967564b6883d.diff
LOG: [TableGen] Simplify copying OperandMap entries for tied operands in CompressInstEmitter. NFC
Copy the whole struct instead of copying both fields.
Added:
Modified:
llvm/utils/TableGen/CompressInstEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/CompressInstEmitter.cpp b/llvm/utils/TableGen/CompressInstEmitter.cpp
index 9da64365bc361..d3e98b3096afe 100644
--- a/llvm/utils/TableGen/CompressInstEmitter.cpp
+++ b/llvm/utils/TableGen/CompressInstEmitter.cpp
@@ -229,9 +229,9 @@ void CompressInstEmitter::addDagOperandMapping(const Record *Rec,
for (const auto &Opnd : Inst.Operands) {
int TiedOpIdx = Opnd.getTiedRegister();
if (-1 != TiedOpIdx) {
+ assert((unsigned)TiedOpIdx < OpNo);
// Set the entry in OperandMap for the tied operand we're skipping.
- OperandMap[OpNo].Kind = OperandMap[TiedOpIdx].Kind;
- OperandMap[OpNo].Data = OperandMap[TiedOpIdx].Data;
+ OperandMap[OpNo] = OperandMap[TiedOpIdx];
if (IsSourceInst)
*SourceLastTiedOpPtr = OpNo;
++OpNo;
@@ -405,8 +405,8 @@ void CompressInstEmitter::createInstOperandMapping(
int TiedInstOpIdx = Operand.getTiedRegister();
if (TiedInstOpIdx != -1) {
++TiedCount;
- DestOperandMap[OpNo].Data = DestOperandMap[TiedInstOpIdx].Data;
- DestOperandMap[OpNo].Kind = DestOperandMap[TiedInstOpIdx].Kind;
+ assert((unsigned)TiedInstOpIdx < OpNo);
+ DestOperandMap[OpNo] = DestOperandMap[TiedInstOpIdx];
if (DestOperandMap[OpNo].Kind == OpData::Operand)
// No need to fill the SourceOperandMap here since it was mapped to
// destination operand 'TiedInstOpIdx' in a previous iteration.
More information about the llvm-commits
mailing list