[llvm-branch-commits] [llvm] ed6a135 - [IVDescriptors] Remove getConsecutiveDirection (NFC)

Kazu Hirata via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 17 20:24:59 PST 2020


Author: Kazu Hirata
Date: 2020-12-17T20:19:15-08:00
New Revision: ed6a135246f01eb7a52bbe321a0b4de1d40b513d

URL: https://github.com/llvm/llvm-project/commit/ed6a135246f01eb7a52bbe321a0b4de1d40b513d
DIFF: https://github.com/llvm/llvm-project/commit/ed6a135246f01eb7a52bbe321a0b4de1d40b513d.diff

LOG: [IVDescriptors] Remove getConsecutiveDirection (NFC)

The last use of the function was removed on Sep 18, 2016 in commit
5f8cc0c3469ba3a7aa440b43aaababa3a6274213.

The function was later moved to llvm/lib/Analysis/IVDescriptors.cpp on
Sep 12, 2018 in commit 7e98d69847aefb1028aaa7131b508f4b4e9896ae.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/IVDescriptors.h
    llvm/lib/Analysis/IVDescriptors.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/IVDescriptors.h b/llvm/include/llvm/Analysis/IVDescriptors.h
index 6e825c7d5351..e736adf899b8 100644
--- a/llvm/include/llvm/Analysis/IVDescriptors.h
+++ b/llvm/include/llvm/Analysis/IVDescriptors.h
@@ -268,12 +268,6 @@ class InductionDescriptor {
   /// Default constructor - creates an invalid induction.
   InductionDescriptor() = default;
 
-  /// Get the consecutive direction. Returns:
-  ///   0 - unknown or non-consecutive.
-  ///   1 - consecutive and increasing.
-  ///  -1 - consecutive and decreasing.
-  int getConsecutiveDirection() const;
-
   Value *getStartValue() const { return StartValue; }
   InductionKind getKind() const { return IK; }
   const SCEV *getStep() const { return Step; }

diff  --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp
index c7e7ddbd8fc2..d9756512de77 100644
--- a/llvm/lib/Analysis/IVDescriptors.cpp
+++ b/llvm/lib/Analysis/IVDescriptors.cpp
@@ -927,13 +927,6 @@ InductionDescriptor::InductionDescriptor(Value *Start, InductionKind K,
   }
 }
 
-int InductionDescriptor::getConsecutiveDirection() const {
-  ConstantInt *ConstStep = getConstIntStepValue();
-  if (ConstStep && (ConstStep->isOne() || ConstStep->isMinusOne()))
-    return ConstStep->getSExtValue();
-  return 0;
-}
-
 ConstantInt *InductionDescriptor::getConstIntStepValue() const {
   if (isa<SCEVConstant>(Step))
     return dyn_cast<ConstantInt>(cast<SCEVConstant>(Step)->getValue());


        


More information about the llvm-branch-commits mailing list