Files
llvm-project/llvm/lib/CodeGen/MachineSink.cpp
Momchil Velikov ef8c94ea8f [MachineSink] Prevent attempts to sink-and-fold into the same instruction more than once (#188048)
When sinking an instruction, we check if the destination instruction can
fold the source instruction into its address mode. If the destination
instruction contains more than one use of the register being sunk, we
won't be able to remove the original instruction, so we should not
attempt to sink.

This also prevents a compiler crash when the destination instruction is
deleted after the first sink-and-fold, and we attempt to sink-and-fold
into it again.

Fixes https://github.com/llvm/llvm-project/issues/187785
2026-03-25 11:52:24 +00:00

88 KiB