summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2016-04-21 14:04:54 +0000
committerChad Rosier <mcrosier@codeaurora.org>2016-04-21 14:04:54 +0000
commitaf83e40dee4270cf5a3b34229b981e6d7a5d07da (patch)
treea97484326d63a4bd521897e08c013d7c40b58186 /llvm/include
parent1978f7fe2999171a43a2a577bc3e771f29abd9ea (diff)
downloadbcm5719-llvm-af83e40dee4270cf5a3b34229b981e6d7a5d07da.tar.gz
bcm5719-llvm-af83e40dee4270cf5a3b34229b981e6d7a5d07da.zip
Refactor implied condition logic from ValueTracking directly into CmpInst. NFC.
Differential Revision: http://reviews.llvm.org/D19330 llvm-svn: 266987
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/IR/InstrTypes.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index e52fa5b7738..ebf9ab0a707 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -1067,6 +1067,18 @@ public:
return isFalseWhenEqual(getPredicate());
}
+ /// @brief Determine if Pred1 implies Pred2 is true when two compares have
+ /// matching operands.
+ bool isTrueWhenOperandsMatch(Predicate Pred2) {
+ return isTrueWhenOperandsMatch(getPredicate(), Pred2);
+ }
+
+ /// @brief Determine if Pred1 implies Pred2 is false when two compares have
+ /// matching operands.
+ bool isFalseWhenOperandsMatch(Predicate Pred2) {
+ return isFalseWhenOperandsMatch(getPredicate(), Pred2);
+ }
+
/// @returns true if the predicate is unsigned, false otherwise.
/// @brief Determine if the predicate is an unsigned operation.
static bool isUnsigned(Predicate predicate);
@@ -1087,6 +1099,14 @@ public:
/// Determine if the predicate is false when comparing a value with itself.
static bool isFalseWhenEqual(Predicate predicate);
+ /// Determine if Pred1 implies Pred2 is true when two compares have matching
+ /// operands.
+ static bool isTrueWhenOperandsMatch(Predicate Pred1, Predicate Pred2);
+
+ /// Determine if Pred1 implies Pred2 is false when two compares have matching
+ /// operands.
+ static bool isFalseWhenOperandsMatch(Predicate Pred1, Predicate Pred2);
+
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const Instruction *I) {
return I->getOpcode() == Instruction::ICmp ||
OpenPOWER on IntegriCloud