[llvm] [DecoderEmitter] Support for DecodeOrder and `resolve-conflicts-try-all` (PR #157948)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 11 00:15:42 PDT 2025
jurahul wrote:
CM_JALT/CM_JT example was with all decoding order removed and with resolve-conflicts-try-all. As you can see above from your experiment, if we don't use resolve-conflicts-try-all, we get a decoding conflict (so decoding order or namespace removed has similar effect) because with more instructions in the mix, the decoder emitter is unable to figure out what to do. With CM_MVA01S/CM_MVSA01 moved back, I guess with the remaining insts, it can make forward progress. In that sense, replacing additional conflict resolving namespaces with DecodeOrder should have the same effect and we can follow the same procedure as before when deciding how to assign DecodeOrder for both hard and soft conflicts. I am assuming soft conflicts are resolved by debugging since tablegen does not issue any error/warnings for these.
That being said, the `resolve-conflicts-try-all` option as implemented here is broken (unspringing as it was not exercised anywhere). The issue is that the current OPC_Decode/TryDecode return as soon as decoding is completed even if it failed. So we need a mode where we return from the decoding code only if decoding is completed and its successful, else keep trying. I have now added support for this as well with a "non-failing" scope which is useful for this linear search. With that, I can get all the RISCV MC tests to pass.
https://github.com/llvm/llvm-project/pull/157948
More information about the llvm-commits
mailing list