summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-02-22 21:46:13 +0000
committerSanjay Patel <spatel@rotateright.com>2018-02-22 21:46:13 +0000
commit0d8f5d1720c33a3485b41388b6c2f610a71bad31 (patch)
tree91145d9fc4ad54d8783103cf2359a1926152cd99
parent70def12a967508c93ed466af80b77031e522d796 (diff)
downloadbcm5719-llvm-0d8f5d1720c33a3485b41388b6c2f610a71bad31.tar.gz
bcm5719-llvm-0d8f5d1720c33a3485b41388b6c2f610a71bad31.zip
[InstrTypes] add frem and fneg with FMF creators
The more popular opcodes were added at r325730, but we should have everything here for symmetry. I think both of these can be used in InstCombine already, but I'll make those changes as separate clean-ups for InstCombine. llvm-svn: 325832
-rw-r--r--llvm/include/llvm/IR/InstrTypes.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index 7aea792ae44..0243c4cb174 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -25,6 +25,7 @@
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/IR/Attributes.h"
+#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/LLVMContext.h"
@@ -411,6 +412,16 @@ public:
const Twine &Name = "") {
return CreateWithCopiedFlags(Instruction::FDiv, V1, V2, FMFSource, Name);
}
+ static BinaryOperator *CreateFRemFMF(Value *V1, Value *V2,
+ BinaryOperator *FMFSource,
+ const Twine &Name = "") {
+ return CreateWithCopiedFlags(Instruction::FRem, V1, V2, FMFSource, Name);
+ }
+ static BinaryOperator *CreateFNegFMF(Value *Op, BinaryOperator *FMFSource,
+ const Twine &Name = "") {
+ Value *Zero = ConstantFP::getNegativeZero(Op->getType());
+ return CreateWithCopiedFlags(Instruction::FSub, Zero, Op, FMFSource);
+ }
static BinaryOperator *CreateNSW(BinaryOps Opc, Value *V1, Value *V2,
const Twine &Name = "") {
OpenPOWER on IntegriCloud