[llvm] [M68k] Prevent COPY instruction from killing live condition flags (PR #168485)
John Paul Adrian Glaubitz via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 06:45:44 PDT 2026
glaubitz wrote:
> > @dansalvato Does this change also address the clobbering of the CCR register of MOVE instructions?
> > We recently discovered that CCR clobbering problem when working on a Rust compiler for the m68k target.
>
> If your issue is that a `MOVE` instruction is clobbering the CCR just before it's used, e.g. `CMP` -> `MOVE` -> `Bcc`, then yes, that's the exact scenario that this patch addresses.
Yes, that's what I was talking about. We've seen LLVM generate assembler where there was CMP instruction and before the result was used, the backend shoved a MOVE instruction inbetween which made the conditional jump fail.
> But if you mean something else, feel free to share some example ASM of the issue you ran into, and I can let you know whether it's relevant to this.
Nope, it's exactly that. Good to know that someone else reproduced it!
https://github.com/llvm/llvm-project/pull/168485
More information about the llvm-commits
mailing list