[PATCH] D143445: [RISCV] Refactor RISCVDisassembler::getInstruction to remove repeated code. NFC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 16:31:40 PST 2023


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, philipp.tomsich, reames.
Herald added subscribers: luke, VincentWu, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

For 4 byte instructions we were always setting size to 4 eventually. Same
for 2 byte instructions. So do it as soon as we know the from the opcode.

Add a return to the end of the 4 byte code so we don't have to have an else
around the 2 byte code.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143445

Files:
  llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143445.495319.patch
Type: text/x-patch
Size: 3863 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230207/f868d908/attachment.bin>


More information about the llvm-commits mailing list