The logic for handling the sinking of COPY instructions was returninggenerating
prematurely due to the placement of DBG_VALUE call instructionsdifferent code when building with debug flags.
The original logic intentionally ignores all call instructions. Sincecode did not take into consideration debug intrinsicsstructions. This
are represented as calls,resulted in the registers in the pass was skipping that block and notDBG_VALUE instructions being treated as used,
performingand prevented the sink. This resulted in different code being generated forCOPY from being sunk. This patch avoids analyzing debug
optimized-with-debug-info and optimized-without-debug-infoinstructions when trying to sink COPY instructions.
I didn't want to create a new test for this; however, I wasn't able to cleanly insert the test into test/CodeGen/AArch64/post-ra-machine-sink.mir, since I would need toThis patch also creates a routine from the code in MachineSinking::SinkInstruction to
perform the logic of sinking an instruction along with its debug instructions.
stub outThis functionality is used in multiple places, in llvm-ir,including the other functions in that test.code for sinking COPY instrs.