summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-11-01 22:56:15 +0000
committerSanjay Patel <spatel@rotateright.com>2018-11-01 22:56:15 +0000
commit0857df38bd3cbff4c30cb1bc4366afacd3cc973d (patch)
treef7eeb9c166708df3cb03446dbdfd8953bc834022
parent8b286f99d4d39aa7847c85f00c111a577a354fef (diff)
downloadbcm5719-llvm-0857df38bd3cbff4c30cb1bc4366afacd3cc973d.tar.gz
bcm5719-llvm-0857df38bd3cbff4c30cb1bc4366afacd3cc973d.zip
[IR] remove fake binop query for fneg
We want to remove this fneg API because it would silently fail if we add an actual fneg instruction to IR (as proposed in D53877 ). We have a newer 'match' API that makes checking for these patterns simpler. It also works with vectors that may include undef elements in constants. If any out-of-tree users need updating, they can model their code changes on this commit: https://reviews.llvm.org/rL345295 llvm-svn: 345904
-rw-r--r--llvm/include/llvm/IR/InstrTypes.h7
-rw-r--r--llvm/lib/IR/Instructions.cpp19
2 files changed, 0 insertions, 26 deletions
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index 4487768e6c6..ec782face6c 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -308,13 +308,6 @@ public:
static BinaryOperator *CreateNot(Value *Op, const Twine &Name,
BasicBlock *InsertAtEnd);
- /// Check if the given Value is an FNeg instruction.
- static bool isFNeg(const Value *V, bool IgnoreZeroSign=false);
-
- /// Helper functions to extract the unary argument of an FNeg.
- static const Value *getFNegArgument(const Value *BinOp);
- static Value *getFNegArgument( Value *BinOp);
-
BinaryOps getOpcode() const {
return static_cast<BinaryOps>(Instruction::getOpcode());
}
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index d92706500bc..3b8d8d0c690 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -2109,25 +2109,6 @@ BinaryOperator *BinaryOperator::CreateNot(Value *Op, const Twine &Name,
Op->getType(), Name, InsertAtEnd);
}
-bool BinaryOperator::isFNeg(const Value *V, bool IgnoreZeroSign) {
- if (const BinaryOperator *Bop = dyn_cast<BinaryOperator>(V))
- if (Bop->getOpcode() == Instruction::FSub)
- if (Constant *C = dyn_cast<Constant>(Bop->getOperand(0))) {
- if (!IgnoreZeroSign)
- IgnoreZeroSign = cast<Instruction>(V)->hasNoSignedZeros();
- return !IgnoreZeroSign ? C->isNegativeZeroValue() : C->isZeroValue();
- }
- return false;
-}
-
-Value *BinaryOperator::getFNegArgument(Value *BinOp) {
- return cast<BinaryOperator>(BinOp)->getOperand(1);
-}
-
-const Value *BinaryOperator::getFNegArgument(const Value *BinOp) {
- return getFNegArgument(const_cast<Value*>(BinOp));
-}
-
// Exchange the two operands to this instruction. This instruction is safe to
// use on any binary instruction and does not modify the semantics of the
// instruction. If the instruction is order-dependent (SetLT f.e.), the opcode
OpenPOWER on IntegriCloud