diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-03 16:33:19 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-08-03 16:33:19 +0000 |
commit | 56e3232d5a5206f8b554eccd4aea2e75e59d4314 (patch) | |
tree | bed661ac4ca24dcf0db211a3cbb7f5108a445b0c /lib/Target/X86/X86FloatingPoint.cpp | |
parent | e3fbe6c0fbf354c05800aabd8b0efc4a9366dc08 (diff) | |
download | llvm-56e3232d5a5206f8b554eccd4aea2e75e59d4314.tar.gz llvm-56e3232d5a5206f8b554eccd4aea2e75e59d4314.tar.bz2 llvm-56e3232d5a5206f8b554eccd4aea2e75e59d4314.tar.xz |
Handle IMPLICIT_DEF instructions in X86FloatingPoint.
This fixes PR10575.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86FloatingPoint.cpp')
-rw-r--r-- | lib/Target/X86/X86FloatingPoint.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp index 6eed6abd43..6f619a9e56 100644 --- a/lib/Target/X86/X86FloatingPoint.cpp +++ b/lib/Target/X86/X86FloatingPoint.cpp @@ -406,6 +406,10 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) { if (MI->isCopy() && isFPCopy(MI)) FPInstClass = X86II::SpecialFP; + if (MI->isImplicitDef() && + X86::RFP80RegClass.contains(MI->getOperand(0).getReg())) + FPInstClass = X86II::SpecialFP; + if (FPInstClass == X86II::NotFP) continue; // Efficiently ignore non-fp insts! @@ -1369,6 +1373,15 @@ void FPS::handleSpecialFP(MachineBasicBlock::iterator &I) { break; } + case TargetOpcode::IMPLICIT_DEF: { + // All FP registers must be explicitly defined, so load a 0 instead. + unsigned Reg = MI->getOperand(0).getReg() - X86::FP0; + DEBUG(dbgs() << "Emitting LD_F0 for implicit FP" << Reg << '\n'); + BuildMI(*MBB, I, MI->getDebugLoc(), TII->get(X86::LD_F0)); + pushReg(Reg); + break; + } + case X86::FpPOP_RETVAL: { // The FpPOP_RETVAL instruction is used after calls that return a value on // the floating point stack. We cannot model this with ST defs since CALL |