<div dir="ltr">Fix miscompile due to StackColoring incorrectly merging stack slots<br><br>IR optimisation passes can result in a basic block that contains:<br><br>  llvm.lifetime.start(%buf)<br>  ...<br>  llvm.lifetime.end(%buf)<br>
  ...<br>  llvm.lifetime.start(%buf)<br><br>Before this change, calculateLiveIntervals() was ignoring the second<br>lifetime.start() and was regarding %buf as being dead from the<br>lifetime.end() through to the end of the basic block.  This can cause<br>
StackColoring to incorrectly merge %buf with another stack slot.<br><br>Fix by removing the incorrect Starts[pos].isValid() and<br>Finishes[pos].isValid() checks.<br><br>Just doing:<br>      Starts[pos] = Indexes->getMBBStartIdx(MBB);<br>
      Finishes[pos] = Indexes->getMBBEndIdx(MBB);<br>unconditionally would be enough to fix the bug, but it causes some<br>test failures due to stack slots not being merged when they were<br>before.  So, in order to keep the existing tests passing, treat LiveIn<br>
and LiveOut separately rather than approximating the live ranges by<br>merging LiveIn and LiveOut.<br><br>This fixes PR15707.<br><br></div>