[llvm] [Codegen] Remove redundant instruction using machinelateCleanup (PR #139716)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 00:59:14 PDT 2025


jayfoad wrote:

See: https://github.com/llvm/llvm-project/blob/10647685ca3cad0107a2f754b21a078405d30359/llvm/include/llvm/CodeGen/MachineOperand.h#L117

`undef %9510.sub_32bit:gr64_with_sub_8bit =` is a def of the low 32 bits of %9510, and acts like an undef read of the high 32 bits. I.e. before this instruction %9510 does not need a definition and after this instruction the high 32 bits are undef.

MOV32r0 does not clear the high 32 bits of `$rax`. It only modifies `$eax` aka the low 32 bits of `$rax`.

https://github.com/llvm/llvm-project/pull/139716


More information about the llvm-commits mailing list