Skip to content

Commit 7293a8d

Browse files
jayfoadAlexisPerry
authored andcommitted
[AMDGPU] Only reinitialize disassembler Bytes array when needed. NFC. (llvm#96666)
1 parent ab29a11 commit 7293a8d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
494494
if (isGFX12() &&
495495
tryDecodeInst(DecoderTableGFX12W6496, MI, DecW, Address, CS))
496496
break;
497-
}
498497

499-
// Reinitialize Bytes
500-
Bytes = Bytes_.slice(0, MaxInstBytesNum);
498+
// Reinitialize Bytes
499+
Bytes = Bytes_.slice(0, MaxInstBytesNum);
500+
}
501501

502502
if (Bytes.size() >= 8) {
503503
const uint64_t QW = eatBytes<uint64_t>(Bytes);
@@ -552,10 +552,10 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
552552
if (isGFX12() &&
553553
tryDecodeInst(DecoderTableGFX12W6464, MI, QW, Address, CS))
554554
break;
555-
}
556555

557-
// Reinitialize Bytes
558-
Bytes = Bytes_.slice(0, MaxInstBytesNum);
556+
// Reinitialize Bytes
557+
Bytes = Bytes_.slice(0, MaxInstBytesNum);
558+
}
559559

560560
// Try decode 32-bit instruction
561561
if (Bytes.size() >= 4) {

0 commit comments

Comments
 (0)