Set correct <def,undef> flags when lowering REG_SEQUENCE.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 24 Jan 2012 23:28:42 +0000 (23:28 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 24 Jan 2012 23:28:42 +0000 (23:28 +0000)
commitd36f5af224594719a10d8b190daf4b56cdb7377f
tree38419ea63d70da10be2fd74ca7ab8c4a13ebe2e6
parent1ce6a36610f06a1fb4047ddde1e9bc2f071c0bfb
Set correct <def,undef> flags when lowering REG_SEQUENCE.

A REG_SEQUENCE instruction is lowered into a sequence of partial defs:

  %vreg7:ssub_0<def,undef> = COPY %vreg20:ssub_0
  %vreg7:ssub_1<def> = COPY %vreg2
  %vreg7:ssub_2<def> = COPY %vreg2
  %vreg7:ssub_3<def> = COPY %vreg2

The first def needs an <undef> flag to indicate it is the beginning of
the live range, while the other defs are read-modify-write.  Previously,
we depended on LiveIntervalAnalysis to notice and fix the missing
<def,undef>, but that solution was never robust, it was causing problems
with ProcessImplicitDefs and the lowering of chained REG_SEQUENCE
instructions.

This fixes PR11841.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148879 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TwoAddressInstructionPass.cpp
test/CodeGen/ARM/2010-06-29-PartialRedefFastAlloc.ll
test/CodeGen/ARM/2012-01-24-RegSequenceLiveRange.ll [new file with mode: 0644]