Permit remat of partial register defs when it is safe.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 1 Sep 2011 18:27:51 +0000 (18:27 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 1 Sep 2011 18:27:51 +0000 (18:27 +0000)
commit4a0a18af4a9a47466a6077a158387ba4f57bf636
treec147d444f5f533499a7252ed62065e83b92fbd01
parent2f25d9b9334662e846460e98a8fe2dae4f233068
Permit remat of partial register defs when it is safe.

An instruction may define part of a register where the other bits are
undefined. In that case, it is safe to rematerialize the instruction.
For example:

  %vreg2:ssub_0<def> = VLDRS <cp#0>, 0, pred:14, pred:%noreg, %vreg2<imp-def>

The extra <imp-def> operand indicates that the instruction does not read
the other parts of the virtual register, so a remat is safe.

This patch simply allows multiple def operands for the virtual register.
It is MI->readsVirtualRegister() that determines if we depend on a
previous value so remat is impossible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138953 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TargetInstrInfoImpl.cpp
test/CodeGen/ARM/subreg-remat.ll