Resolves: https://github.com/llvm/llvm-project/issues/62452 Currently, `TwoAddressInstructionPass` has a blanket rule against moving kill copies, since many copies are better handled later by coalescing. However, that rule is too strict when the kill is a virtual register to physical register copy and the current two-address instruction has a folded load. In that case, keeping the copy in place can force the pass to break the folded rm form into a mov rm + op rr, even though the physical register copy itself cannot be coalesced away in the usual sense. This fixes a missed optimization where a folded IMUL64rm was rewritten into MOV64rm + IMUL64rr because a later $rax = COPY %src was kept in place for mul.
77 KiB
77 KiB