maksfb wrote: The change is in the right direction. However, we need to cover the handling of `jrcxz` in one of the passes. I will publish a PR with a fix to `bolt/test/X86/bug-reorder-bb-jrcxz.s`. https://github.com/llvm/llvm-project/pull/95572