[llvm] bb97378 - [AMDGPU] Only reinitialize disassembler Bytes array when needed. NFC. (#96666)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 27 07:45:34 PDT 2024
Author: Jay Foad
Date: 2024-06-27T15:45:30+01:00
New Revision: bb973785c9df1bf191ac4ff06ab1e7355dbd95c6
URL: https://github.com/llvm/llvm-project/commit/bb973785c9df1bf191ac4ff06ab1e7355dbd95c6
DIFF: https://github.com/llvm/llvm-project/commit/bb973785c9df1bf191ac4ff06ab1e7355dbd95c6.diff
LOG: [AMDGPU] Only reinitialize disassembler Bytes array when needed. NFC. (#96666)
Added:
Modified:
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
index 76a559c9443bd..0c0e9163fc6ef 100644
--- a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+++ b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
@@ -494,10 +494,10 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
if (isGFX12() &&
tryDecodeInst(DecoderTableGFX12W6496, MI, DecW, Address, CS))
break;
- }
- // Reinitialize Bytes
- Bytes = Bytes_.slice(0, MaxInstBytesNum);
+ // Reinitialize Bytes
+ Bytes = Bytes_.slice(0, MaxInstBytesNum);
+ }
if (Bytes.size() >= 8) {
const uint64_t QW = eatBytes<uint64_t>(Bytes);
@@ -552,10 +552,10 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
if (isGFX12() &&
tryDecodeInst(DecoderTableGFX12W6464, MI, QW, Address, CS))
break;
- }
- // Reinitialize Bytes
- Bytes = Bytes_.slice(0, MaxInstBytesNum);
+ // Reinitialize Bytes
+ Bytes = Bytes_.slice(0, MaxInstBytesNum);
+ }
// Try decode 32-bit instruction
if (Bytes.size() >= 4) {
More information about the llvm-commits
mailing list