[RDA][ARM][LowOverheadLoops] Iteration count IT blocks
authorSam Parker <sam.parker@arm.com>
Mon, 24 Feb 2020 13:50:46 +0000 (13:50 +0000)
committerSam Parker <sam.parker@arm.com>
Mon, 24 Feb 2020 13:51:03 +0000 (13:51 +0000)
commita67eb221e2281350eeab5dd4b9119895c500674c
tree865cdbcb7768f895f8cafe7815b57ab291de4856
parentbd5b22070b6984d89c13b6cf38c3e54fc98ce291
[RDA][ARM][LowOverheadLoops] Iteration count IT blocks

Change the way that we remove the redundant iteration count code in
the presence of IT blocks. collectLocalKilledOperands has been
introduced to scan an instructions operands, collecting the killed
instructions and then visiting them too. This is used to delete the
code in the preheader which calculates the iteration count. We also
track any IT blocks within the preheader and, if we remove all the
instructions from the IT block, we also remove the IT instruction.
isSafeToRemove is used to remove any redundant uses of the iteration
count within the loop body.

Differential Revision: https://reviews.llvm.org/D74975
llvm/include/llvm/CodeGen/ReachingDefAnalysis.h
llvm/lib/CodeGen/ReachingDefAnalysis.cpp
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
llvm/test/CodeGen/Thumb2/LowOverheadLoops/dont-ignore-vctp.mir
llvm/test/CodeGen/Thumb2/LowOverheadLoops/it-block-chain.mir
llvm/test/CodeGen/Thumb2/LowOverheadLoops/it-block-itercount.mir
llvm/test/CodeGen/Thumb2/LowOverheadLoops/it-block-mov.mir [new file with mode: 0644]
llvm/test/CodeGen/Thumb2/LowOverheadLoops/it-block-random.mir