aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2022-09-21 10:42:03 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2022-09-22 09:51:15 -0400
commit94ebd7d9ff1776bbc94ca6ac82a783fa9d4eaa72 (patch)
tree8ec4d1605b39e27926c3b7b15bedf148dc63b343 /llvm/lib/CodeGen/MachineOperand.cpp
parentc2e76f914c9ac0dd15e4a8040a5e277333f91f97 (diff)
downloadllvm-94ebd7d9ff1776bbc94ca6ac82a783fa9d4eaa72.zip
llvm-94ebd7d9ff1776bbc94ca6ac82a783fa9d4eaa72.tar.gz
llvm-94ebd7d9ff1776bbc94ca6ac82a783fa9d4eaa72.tar.bz2
MachineVerifier: Verify REG_SEQUENCE
Somehow there was no verification of this, other than an ad-hoc assertion in TwoAddressInstructions.
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index df52741..797b3de 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -531,7 +531,7 @@ static void printFrameIndex(raw_ostream& OS, int FrameIndex, bool IsFixed,
void MachineOperand::printSubRegIdx(raw_ostream &OS, uint64_t Index,
const TargetRegisterInfo *TRI) {
OS << "%subreg.";
- if (TRI)
+ if (TRI && Index != 0 && Index < TRI->getNumSubRegIndices())
OS << TRI->getSubRegIndexName(Index);
else
OS << Index;