[CodeGenPrepare] The instruction to be sunk should be inserted before its user in...
authorTiehu Zhang <zhangtiehu@huawei.com>
Tue, 17 Aug 2021 10:50:54 +0000 (18:50 +0800)
committerPeilin Guo <guopeilin1@huawei.com>
Tue, 17 Aug 2021 10:58:15 +0000 (18:58 +0800)
commit9cfa9b44a589438d3c6920881c5619c76479dbaa
tree3e18cdcd30e4296a2e5b3680f37c6772f7d834f2
parent708cbda5771aecf84e93c4e7f5d6f78bbc92af6e
[CodeGenPrepare] The instruction to be sunk should be inserted before its user in a block

In current implementation, the instruction to be sunk will be inserted before the target instruction without considering the def-use tree,
which may case Instruction does not dominate all uses error. We need to choose a suitable location to insert according to the use chain

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D107262
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/Transforms/CodeGenPrepare/AArch64/sink-free-instructions-inseltpoison.ll
llvm/test/Transforms/CodeGenPrepare/AArch64/sink-free-instructions.ll
llvm/test/Transforms/CodeGenPrepare/ARM/sink-free-instructions-inseltpoison.ll
llvm/test/Transforms/CodeGenPrepare/ARM/sink-free-instructions.ll