[llvm] [DecoderEmitter] Eliminate `DecodeComplete` parameter to `decodeToMCInst` (PR #159130)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 13:10:28 PDT 2025


s-barannikov wrote:

Now I think that Decode is redundant :)

1. In `Decode` case, `decodeToMCInst` always returns `DecodeComplete` set to true. It is `assert`ed, so I can't be wrong here.
2. If `decodeToMCInst` returns `DecodeComplete` set to true, `TryDecode` behaves exactly like `Decode` -- returns the decoded instruction and the status.

So we could always emit `TryDecode`. The cost is an additional check for `DecodeComplete`, which should be tiny compared to the cost of a decoder function.


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


More information about the llvm-commits mailing list