summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-02-07 07:56:26 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-02-07 07:56:26 +0000
commitdd5ee6f5d9af2424236fa2ea74b6686e41050fe6 (patch)
tree6e672023c8ed51ac6168f66e3340f5722952697b /llvm/include
parentcae66ba5f8dd803103904fd38a1e85d7c5d234de (diff)
downloadbcm5719-llvm-dd5ee6f5d9af2424236fa2ea74b6686e41050fe6.tar.gz
bcm5719-llvm-dd5ee6f5d9af2424236fa2ea74b6686e41050fe6.zip
[SCEV] Make isLoopEntryGuardedByCond a bit smarter
Sometimes `isLoopEntryGuardedByCond` cannot prove predicate `a > b` directly. But it is a common situation when `a >= b` is known from ranges and `a != b` is known from a dominating condition. Thia patch teaches SCEV to sum these facts together and prove strict comparison via non-strict one. Differential Revision: https://reviews.llvm.org/D42835 llvm-svn: 324453
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/IR/InstrTypes.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index 871f702f95f..9e938a462cf 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -973,6 +973,19 @@ public:
/// @brief Return the predicate as if the operands were swapped.
static Predicate getSwappedPredicate(Predicate pred);
+ /// For example, SGT -> SGE, SLT -> SLE, ULT -> ULE, UGT -> UGE.
+ /// @brief Returns the non-strict version of strict comparisons.
+ Predicate getNonStrictPredicate() const {
+ return getNonStrictPredicate(getPredicate());
+ }
+
+ /// This is a static version that you can use without an instruction
+ /// available.
+ /// @returns the non-strict version of comparison provided in \p pred.
+ /// If \p pred is not a strict comparison predicate, returns \p pred.
+ /// @brief Returns the non-strict version of strict comparisons.
+ static Predicate getNonStrictPredicate(Predicate pred);
+
/// @brief Provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
OpenPOWER on IntegriCloud