[llvm] [AMDGPU] Only reinitialize disassembler Bytes array when needed. NFC. (PR #96666)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 07:42:52 PDT 2024


================
@@ -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);
----------------
jayfoad wrote:

Each "reinitialize" is now paired with the earlier "eatSomething(Bytes)" which mutated it.

https://github.com/llvm/llvm-project/pull/96666


More information about the llvm-commits mailing list