[PATCH] D12949: [SCEV] Split out a helper function from isImpliedCond; NFC.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 13:01:39 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL248607: [SCEV] Extract helper function from isImpliedCond; NFC (authored by sanjoy).

Changed prior to commit:
  http://reviews.llvm.org/D12949?vs=35056&id=35756#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D12949

Files:
  llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
  llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Index: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp
@@ -7151,6 +7151,14 @@
   const SCEV *FoundLHS = getSCEV(ICI->getOperand(0));
   const SCEV *FoundRHS = getSCEV(ICI->getOperand(1));
 
+  return isImpliedCond(Pred, LHS, RHS, FoundPred, FoundLHS, FoundRHS);
+}
+
+bool ScalarEvolution::isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS,
+                                    const SCEV *RHS,
+                                    ICmpInst::Predicate FoundPred,
+                                    const SCEV *FoundLHS,
+                                    const SCEV *FoundRHS) {
   // Balance the types.
   if (getTypeSizeInBits(LHS->getType()) <
       getTypeSizeInBits(FoundLHS->getType())) {
Index: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
===================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
@@ -507,6 +507,13 @@
                        bool Inverse);
 
     /// Test whether the condition described by Pred, LHS, and RHS is true
+    /// whenever the condition described by FoundPred, FoundLHS, FoundRHS is
+    /// true.
+    bool isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS,
+                       const SCEV *RHS, ICmpInst::Predicate FoundPred,
+                       const SCEV *FoundLHS, const SCEV *FoundRHS);
+
+    /// Test whether the condition described by Pred, LHS, and RHS is true
     /// whenever the condition described by Pred, FoundLHS, and FoundRHS is
     /// true.
     bool isImpliedCondOperands(ICmpInst::Predicate Pred,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12949.35756.patch
Type: text/x-patch
Size: 1769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150925/7c9ebe35/attachment.bin>


More information about the llvm-commits mailing list