ARM: When re-creating a branch via InsertBranch, preserve CPSR flags.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 23 Apr 2015 20:31:32 +0000 (20:31 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 23 Apr 2015 20:31:32 +0000 (20:31 +0000)
commit1ad0f741557afc28b626cb6fde8113e8aa997332
tree56611039e52ae0b9d78656faababb6c0da813fe9
parentd9a479e5a0364ffd04b9ff2af3d2baaa4cd27a6d
ARM: When re-creating a branch via InsertBranch, preserve CPSR flags.

In particular, this preserves the kill flag, which allows the Thumb2 cbn?z
optimization to be applied in cases where a branch has been re-created after
the live variables analysis pass, e.g. by the machine block placement pass.

This appears to be low risk; a number of other targets seem to already be
doing something similar, e.g. AArch64, PowerPC.

Differential Revision: http://reviews.llvm.org/D9184

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235639 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMBaseInstrInfo.cpp
test/CodeGen/ARM/sjlj-prepare-critical-edge.ll
test/CodeGen/Thumb2/v8_IT_5.ll