OSDN Git Service

LivePhysRegs: Fix addLiveOutsNoPristines() for return blocks past PEI
authorMatthias Braun <matze@braunis.de>
Fri, 26 May 2017 16:23:08 +0000 (16:23 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 26 May 2017 16:23:08 +0000 (16:23 +0000)
commitbfcbf6ad0025f3e68fb081754e68109af888a091
tree78b9a466f08db2d323f8ce58da84f5955c7772bd
parentf0ed1790a610ebae3a942c82104c419911526952
LivePhysRegs: Fix addLiveOutsNoPristines() for return blocks past PEI

Re-commit r303938 and r303954 with a fix for addLiveIns(): the internal
addPristines() function must be called on an empty set or it may
accidentally reset saved registers.

- addLiveOutsNoPristines() needs to add callee saved registers that are
  actually saved and restored somewhere to the set (they are not
  pristine).
- Cleanup/rewrite the code for addLiveOuts()/addLiveOutsNoPristines().

This fixes the problem from D32156.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304001 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LivePhysRegs.cpp
test/CodeGen/PowerPC/livephysregs.mir [new file with mode: 0644]