diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp index a4b4bf2973d1..4ea714ff15f7 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp @@ -109,6 +109,16 @@ namespace { // Track the operand that kill Reg. We would unset the kill flag of // the operand if there is a following redundant load immediate. int KillIdx = AfterBBI->findRegisterUseOperandIdx(Reg, true, TRI); + + // We can't just clear implicit kills, so if we encounter one, stop + // looking further. + if (KillIdx != -1 && AfterBBI->getOperand(KillIdx).isImplicit()) { + LLVM_DEBUG(dbgs() + << "Encountered an implicit kill, cannot proceed: "); + LLVM_DEBUG(AfterBBI->dump()); + break; + } + if (KillIdx != -1) { assert(!DeadOrKillToUnset && "Shouldn't kill same register twice"); DeadOrKillToUnset = &AfterBBI->getOperand(KillIdx); |