https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112572
--- Comment #15 from Sam James <sjames at gcc dot gnu.org> --- Looks like it's extractInstructionFeatures (https://github.com/llvm/llvm-project/blob/llvmorg-17.0.5/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp#L943). Adding __attribute__((optimize("O0"))) to it makes the test pass.