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
88 KiB
88 KiB