llvm-6502/test/CodeGen
Derek Schuff c22cdb7203 Fix miscompile due to StackColoring incorrectly merging stack slots (PR15707)
IR optimisation passes can result in a basic block that contains:

  llvm.lifetime.start(%buf)
  ...
  llvm.lifetime.end(%buf)
  ...
  llvm.lifetime.start(%buf)

Before this change, calculateLiveIntervals() was ignoring the second
lifetime.start() and was regarding %buf as being dead from the
lifetime.end() through to the end of the basic block.  This can cause
StackColoring to incorrectly merge %buf with another stack slot.

Fix by removing the incorrect Starts[pos].isValid() and
Finishes[pos].isValid() checks.

Just doing:
      Starts[pos] = Indexes->getMBBStartIdx(MBB);
      Finishes[pos] = Indexes->getMBBEndIdx(MBB);
unconditionally would be enough to fix the bug, but it causes some
test failures due to stack slots not being merged when they were
before.  So, in order to keep the existing tests passing, treat LiveIn
and LiveOut separately rather than approximating the live ranges by
merging LiveIn and LiveOut.

This fixes PR15707.
Patch by Mark Seaborn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181922 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-15 21:15:09 +00:00
..
AArch64
ARM ARM ISel: Don't create illegal types during LowerMUL 2013-05-14 22:33:24 +00:00
CPP
Generic
Hexagon Hexagon: Pass to replace tranfer/copy instructions into combine instruction 2013-05-14 18:54:06 +00:00
Inputs
MBlaze
Mips This is the first of three patches which creates stubs used for 2013-05-14 02:00:24 +00:00
MSP430 DAGCombiner: Simplify inverted bit tests 2013-05-08 06:44:42 +00:00
NVPTX
PowerPC PPC32: Fix stack collision between FP and CR save areas. 2013-05-14 16:08:32 +00:00
R600 R600/SI: Add lit test coverage for the remaining patterns added recently 2013-05-14 09:53:30 +00:00
SI
SPARC Recognize sparc64 as an alias for sparcv9 triples. 2013-05-14 17:47:27 +00:00
SystemZ [SystemZ] Make use of SUBTRACT HALFWORD 2013-05-15 15:05:29 +00:00
Thumb
Thumb2 Fix ARM FastISel tests, as a first step to enabling ARM FastISel 2013-05-14 16:26:38 +00:00
X86 Fix miscompile due to StackColoring incorrectly merging stack slots (PR15707) 2013-05-15 21:15:09 +00:00
XCore [XCore] Fix handling of functions where only the LR is spilled. 2013-05-09 16:43:42 +00:00