[llvm] Reapply "[LLVM][TableGen] Parameterize NumToSkip in DecoderEmitter" (#136017) (PR #136019)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 17 10:48:12 PDT 2025
jurahul wrote:
I debugged the failures with expensive check builds, and it seems to be nothing to do with expensive checks but due to a possible conflict between different versions of `decodeInstruction` functions that are generated. With my change, we generate either a version that accepts 2 bytes for NumToSkip for some targets and 3 bytes for other. However, the function is declared as a templated static function in the `llvm` namespace. In the failing build, I saw that for the ARM target, which should be using 2 bytes, the code was exercising a function that expects 3 bytes, and then the traversal through the table goes astray.
I think this has something to do with these functions are not purely local (they are declared in the llvm namespace) so at link time the compiler may see 2 copies that are not identical and choose to merge them, leading to correctness issues. I think one difference between my regular setup and the expensive check build was clang vs gcc for building. Maybe clang and gcc handle these cases differently (clang does not merge and gcc merges them).
https://github.com/llvm/llvm-project/pull/136019
More information about the llvm-commits
mailing list