Skip to content

Commit

Permalink
[RISCV] Duplicate pseudo expansion comment to RISCVMCCodeEmitter
Browse files Browse the repository at this point in the history
Follow-on from D77443. Although we're not fixing any of these
pseudo-instructions, the potential for them to be out of sync still
exists.
  • Loading branch information
jrtc27 committed Jul 15, 2020
1 parent 3382c24 commit 2dc16fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ void RISCVMCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS,
// Get byte count of instruction.
unsigned Size = Desc.getSize();

// RISCVInstrInfo::getInstSizeInBytes hard-codes the number of expanded
// instructions for each pseudo, and must be updated when adding new pseudos
// or changing existing ones.
if (MI.getOpcode() == RISCV::PseudoCALLReg ||
MI.getOpcode() == RISCV::PseudoCALL ||
MI.getOpcode() == RISCV::PseudoTAIL ||
Expand Down

0 comments on commit 2dc16fb

Please sign in to comment.