[ARM][LowOverheadLoops] Fix loop count chain
authorSam Parker <sam.parker@arm.com>
Wed, 5 Feb 2020 13:20:50 +0000 (13:20 +0000)
committerSam Parker <sam.parker@arm.com>
Wed, 5 Feb 2020 13:21:51 +0000 (13:21 +0000)
commit564275289da3bc574fc91148584972ac2d4c21f3
treeef9efa06c9710d5172baaee8eb38bed60adea504
parent4c7f819204d8c52a25cc98a083791ad9db7d1ad9
[ARM][LowOverheadLoops] Fix loop count chain

Checking that the use-def chain that performs the loop count
isSafeToRemove is not sufficient because it means that we can
remove register copies that we need to restore lr to its correct
value. This change now prevents the transform from kicking in for the
'remove-elem-moves' test which needs to addressed later on.

Differential Revision: https://reviews.llvm.org/D74037
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
llvm/test/CodeGen/Thumb2/LowOverheadLoops/loop-dec-copy-chain.mir [new file with mode: 0644]
llvm/test/CodeGen/Thumb2/LowOverheadLoops/loop-dec-copy-prev-iteration.mir [new file with mode: 0644]
llvm/test/CodeGen/Thumb2/LowOverheadLoops/loop-dec-liveout.mir [new file with mode: 0644]
llvm/test/CodeGen/Thumb2/LowOverheadLoops/remove-elem-moves.mir