Make it possible to create an SCEVUnknown from an APInt as well as an int.
authorReid Spencer <rspencer@reidspencer.com>
Thu, 1 Mar 2007 22:28:51 +0000 (22:28 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Thu, 1 Mar 2007 22:28:51 +0000 (22:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34816 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolutionExpressions.h
lib/Analysis/ScalarEvolution.cpp

index b9bf93b8c79aea3069269ef23a831881aac12412..af795377c2b95e39d1557042d829d36ae8b53817 100644 (file)
@@ -19,6 +19,7 @@
 namespace llvm {
   class ConstantInt;
   class ConstantRange;
+  class APInt;
 
   enum SCEVTypes {
     // These should be ordered in terms of increasing complexity to make the
@@ -463,6 +464,7 @@ namespace llvm {
     /// getIntegerSCEV - Given an integer or FP type, create a constant for the
     /// specified signed integer value and return a SCEV for the constant.
     static SCEVHandle getIntegerSCEV(int Val, const Type *Ty);
+    static SCEVHandle getIntegerSCEV(const APInt& Val);
 
     Value *getValue() const { return V; }
 
index f0a44c774d01e97748483dc6badb794e2a3bab29..52b0af4e14ce62d7e52433196003e8d450be0769 100644 (file)
@@ -460,6 +460,10 @@ SCEVHandle SCEVUnknown::getIntegerSCEV(int Val, const Type *Ty) {
   return SCEVUnknown::get(C);
 }
 
+SCEVHandle SCEVUnknown::getIntegerSCEV(const APInt& Val) {
+  return SCEVUnknown::get(ConstantInt::get(Val));
+}
+
 /// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion of the
 /// input value to the specified type.  If the type must be extended, it is zero
 /// extended.