1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Make sure candidate for delay slot filler is not a return instruction.

llvm-svn: 141196
This commit is contained in:
Akira Hatanaka 2011-10-05 18:16:09 +00:00
parent 779ae47721
commit 9c77dc9579

View File

@ -174,15 +174,16 @@ bool Filler::delayHasHazard(MachineBasicBlock::iterator candidate,
if (candidate->isImplicitDef() || candidate->isKill())
return true;
MCInstrDesc MCID = candidate->getDesc();
// Loads or stores cannot be moved past a store to the delay slot
// and stores cannot be moved past a load.
if (candidate->getDesc().mayLoad()) {
if (MCID.mayLoad()) {
if (sawStore)
return true;
sawLoad = true;
}
if (candidate->getDesc().mayStore()) {
if (MCID.mayStore()) {
if (sawStore)
return true;
sawStore = true;
@ -190,7 +191,8 @@ bool Filler::delayHasHazard(MachineBasicBlock::iterator candidate,
return true;
}
assert(!candidate->getDesc().isCall() && "Cannot put calls in delay slot.");
assert((!MCID.isCall() && !MCID.isReturn()) &&
"Cannot put calls in delay slot.");
for (unsigned i = 0, e = candidate->getNumOperands(); i!= e; ++i) {
const MachineOperand &MO = candidate->getOperand(i);