Fix issues that the local allocator has dealing with instructions that implicitly use ST(0)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12855 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2004-04-12 03:02:48 +00:00
parent 284b496aae
commit 133dbb1285
5 changed files with 24 additions and 15 deletions

View File

@ -934,7 +934,7 @@ unsigned ISel::EmitComparison(unsigned OpNum, Value *Op0, Value *Op1,
BuildMI(*MBB, IP, X86::FNSTSW8r, 0);
BuildMI(*MBB, IP, X86::SAHF, 1);
} else {
BuildMI(*MBB, IP, X86::FUCOMIr, 2).addReg(Op0r).addReg(Op1r);
BuildMI(*MBB, IP, X86::FpUCOMI, 2).addReg(Op0r).addReg(Op1r);
}
break;
@ -1774,6 +1774,10 @@ static bool isSafeToFoldLoadIntoInstruction(LoadInst &LI, Instruction &User) {
case Instruction::Call:
case Instruction::Invoke:
return false;
case Instruction::Load:
if (cast<LoadInst>(It)->isVolatile() && LI.isVolatile())
return false;
break;
}
}
return true;