diff options
author | Duncan Sands <baldrick@free.fr> | 2012-04-16 19:39:33 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2012-04-16 19:39:33 +0000 |
commit | 9af6298293fdafe38f5b90b9f79c0aaeeaf83ec8 (patch) | |
tree | ae32486d6107c4c26db5dcd795cb22bc79d98b39 /llvm/lib/VMCore/Instructions.cpp | |
parent | 2f5b7c542e688701037bedb040c2b39d021acf14 (diff) | |
download | bcm5719-llvm-9af6298293fdafe38f5b90b9f79c0aaeeaf83ec8.tar.gz bcm5719-llvm-9af6298293fdafe38f5b90b9f79c0aaeeaf83ec8.zip |
Remove support for the special 'fast' value for fpmath accuracy for the moment.
llvm-svn: 154850
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 185cd0557c1..6c5db328764 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -2008,35 +2008,14 @@ bool BinaryOperator::isExact() const { /// getFPAccuracy - Get the maximum error permitted by this operation in ULPs. /// An accuracy of 0.0 means that the operation should be performed with the -/// default precision. A huge value is returned if the accuracy is 'fast'. +/// default precision. float FPMathOperator::getFPAccuracy() const { const MDNode *MD = cast<Instruction>(this)->getMetadata(LLVMContext::MD_fpmath); if (!MD) return 0.0; - Value *Op = MD->getOperand(0); - if (const ConstantFP *Accuracy = dyn_cast<ConstantFP>(Op)) - return Accuracy->getValueAPF().convertToFloat(); - // If it's not a floating point number then it must be 'fast'. - assert(isa<MDString>(Op) && cast<MDString>(Op)->getString() == "fast" && - "Expected the 'fast' keyword!"); - return HUGE_VALF; -} - -/// isFastFPAccuracy - Return true if the accuracy is 'fast'. This says that -/// speed is more important than accuracy. -bool FPMathOperator::isFastFPAccuracy() const { - const MDNode *MD = - cast<Instruction>(this)->getMetadata(LLVMContext::MD_fpmath); - if (!MD) - return false; - Value *Op = MD->getOperand(0); - if (isa<ConstantFP>(Op)) - return false; - // If it's not a floating point number then it must be 'fast'. - assert(isa<MDString>(Op) && cast<MDString>(Op)->getString() == "fast" && - "Expected the 'fast' keyword!"); - return true; + ConstantFP *Accuracy = cast<ConstantFP>(MD->getOperand(0)); + return Accuracy->getValueAPF().convertToFloat(); } |