[llvm] [MachineCopyPropagation] Recognise and delete no-op moves produced after forwarded uses (PR #129889)
Steven Michaud via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 4 07:23:18 PST 2025
steven-michaud wrote:
The basic problem here is very simple. @mstorsjo mentioned it above months ago. But it looks like it's been forgotten, so I'll mention it again: A `mov w[n],w[n]` clears the upper 32 bits of the `[n]` register. Removing that instruction can leave the `[n]` register's upper 32 bits full of junk. This can lead to crashes many instructions later. I've already found [one case of this](https://bugzilla.mozilla.org/show_bug.cgi?id=1995582), which I confirmed running Firefox in `lldb`. I'm sure there are many others.
It will be very difficult to decide in which cases the "junk" matters and in which it doesn't. I suspect there isn't any general solution, and no complete set of specific ones.
https://github.com/llvm/llvm-project/pull/129889
More information about the llvm-commits
mailing list