OSDN Git Service

[ARM] Allow the scheduler to clone a node with glue to avoid a copy CPSR ↔ GPR.
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>
Wed, 31 Jan 2018 09:23:43 +0000 (09:23 +0000)
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>
Wed, 31 Jan 2018 09:23:43 +0000 (09:23 +0000)
commitdbea76e0ee1ebfe69be2b9d0385f66299f1fb8c3
tree63a667d14999cac5fb47fae63cab0830ec623225
parent2589f81ceeeaf40b33430912b1512ecf96089ea8
[ARM] Allow the scheduler to clone a node with glue to avoid a copy CPSR ↔ GPR.

In Thumb 1, with the new ADDCARRY / SUBCARRY the scheduler may need to do
copies CPSR ↔ GPR but not all Thumb1 targets implement them.

The schedule can attempt, before attempting a copy, to clone the instructions
but it does not currently do that for nodes with input glue. In this patch we
introduce a target-hook to let the hook decide if a glued machinenode is still
eligible for copying. In this case these are ARM::tADCS and ARM::tSBCS .

As a follow-up of this change we should actually implement the copies for the
Thumb1 targets that do implement them and restrict the hook to the targets that
can't really do such copy as these clones are not ideal.

This change fixes PR35836.

Differential Revision: https://reviews.llvm.org/D42051

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323857 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetInstrInfo.h
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
lib/Target/ARM/Thumb1InstrInfo.cpp
lib/Target/ARM/Thumb1InstrInfo.h
test/CodeGen/Thumb/pr35836.ll [new file with mode: 0644]
test/CodeGen/Thumb/pr35836_2.ll [new file with mode: 0644]