[PowerPC] Remove wild call to RegScavenger::initRegState().

This call should in fact be made by RegScavenger::enterBasicBlock()
called below. The first call does nothing except for triggering UB,
indicated by UBSan (passing nullptr to memset()).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov 2015-12-02 21:25:28 +00:00
parent 9343bd9aff
commit dae9c83029
2 changed files with 4 additions and 6 deletions

View File

@ -74,10 +74,6 @@ public:
/// Start tracking liveness from the begin of the specific basic block.
void enterBasicBlock(MachineBasicBlock *mbb);
/// Allow resetting register state info for multiple
/// passes over/within the same function.
void initRegState();
/// Move the internal MBB iterator and update register states.
void forward();
@ -180,6 +176,9 @@ private:
unsigned InstrLimit,
MachineBasicBlock::iterator &UseMI);
/// Allow resetting register state info for multiple
/// passes over/within the same function.
void initRegState();
};
} // End llvm namespace

View File

@ -569,8 +569,7 @@ bool PPCFrameLowering::findScratchRegister(MachineBasicBlock *MBB,
if ((UseAtEnd && MBB->isReturnBlock()) ||
(!UseAtEnd && (&MBB->getParent()->front() == MBB)))
return true;
RS.initRegState();
RS.enterBasicBlock(MBB);
if (UseAtEnd && !MBB->empty()) {