[all-commits] [llvm/llvm-project] d7ee99: [MachineSink] Clear kill flags of sunk addressing ...
Momchil Velikov via All-commits
all-commits at lists.llvm.org
Wed Dec 13 01:15:42 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d7ee99a4fc1108d6d5ae1b28cb71a57530723fc7
https://github.com/llvm/llvm-project/commit/d7ee99a4fc1108d6d5ae1b28cb71a57530723fc7
Author: Momchil Velikov <momchil.velikov at arm.com>
Date: 2023-12-13 (Wed, 13 Dec 2023)
Changed paths:
M llvm/lib/CodeGen/MachineSink.cpp
A llvm/test/CodeGen/AArch64/sink-and-fold-clear-kill-flags.mir
Log Message:
-----------
[MachineSink] Clear kill flags of sunk addressing mode registers (#75072)
When doing sink-and-fold, the MachineSink clears the "killed" flags of
the operands of the sunk (and deleted) instruction. However, this is not
always sufficient. In some cases we can create the new load/store
instruction with operands other than the ones present in the deleted
instruction. One such example is folding a zero word extend into a
memory load on AArch64. The zero-extend is represented by a pair of
instructions - `MOV` (i.e. `ORRwrs`) followed by a `SUBREG_TO_REG`. The
`SUBREG_TO_REG` is deleted (it is the sunk instruction), but the new
load instruction mentions operands "killed" in the `MOV`, which is no
longer correct.
To fix this, clear the "killed" flags of the registers participating in
the addressing mode.
More information about the All-commits
mailing list