1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

getPristineRegs is not accurately considering shrink wrapping puts

registers not saved in certain blocks. Use explicit getCalleeSavedInfo
and isLiveIn instead.

This fixes pr32292.

Patch by Tim Shen!

llvm-svn: 299124
This commit is contained in:
Eric Christopher 2017-03-30 22:34:20 +00:00
parent c348b0516a
commit aec06d7e89
3 changed files with 8 additions and 2 deletions

View File

@ -4593,6 +4593,9 @@ bool LLParser::parseConstantValue(Type *Ty, Constant *&C) {
C = cast<Constant>(V);
return false;
}
case ValID::t_Null:
C = Constant::getNullValue(Ty);
return false;
default:
return Error(Loc, "expected a constant value");
}

View File

@ -166,7 +166,8 @@ void AggressiveAntiDepBreaker::StartBlock(MachineBasicBlock *BB) {
for (const MCPhysReg *I = MF.getRegInfo().getCalleeSavedRegs(); *I;
++I) {
unsigned Reg = *I;
if (!IsReturnBlock && !Pristine.test(Reg)) continue;
if (!IsReturnBlock && !(Pristine.test(Reg) || BB->isLiveIn(Reg)))
continue;
for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) {
unsigned AliasReg = *AI;
State->UnionGroups(AliasReg, 0);

View File

@ -73,7 +73,9 @@ void CriticalAntiDepBreaker::StartBlock(MachineBasicBlock *BB) {
BitVector Pristine = MFI.getPristineRegs(MF);
for (const MCPhysReg *I = MF.getRegInfo().getCalleeSavedRegs(); *I;
++I) {
if (!IsReturnBlock && !Pristine.test(*I)) continue;
unsigned Reg = *I;
if (!IsReturnBlock && !(Pristine.test(Reg) || BB->isLiveIn(Reg)))
continue;
for (MCRegAliasIterator AI(*I, TRI, true); AI.isValid(); ++AI) {
unsigned Reg = *AI;
Classes[Reg] = reinterpret_cast<TargetRegisterClass *>(-1);