This patch adds support to sink side-effecting calls that are legal to
sink to the successor use block. We can sink such calls as long as these
two conditions are satisfied:
- The instruction would be trivially dead (i.e. if there were no uses of the instruction, we can remove the instruction).
- There are no side-effecting instructions between the current one until the end of the block.
This helps with sinking allocations down to use blocks when safe to do
so (see added testcases).
clang-tidy: warning: invalid case style for function 'TryToSinkInstruction' [readability-identifier-naming]
not useful