[llvm-dev] Support for Range analysis in LLVM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[llvm-dev] Support for Range analysis in LLVM

Hal Finkel via llvm-dev

Hi,


I wish to compile something like - 


bits(4) UInt( bits(2) x )

{

     switch(b) 

     {

          case 0:

               return '0000';

         case 1: 

               return '0001';

         case 2 : 

              return '0010';

         case 3:  

             return '0011';


    }

}


int datasize = UInt(a);



My Question: Is there some way to perform Range Analysis over the function "UInt()" return value ?


It would be great if someone can help me out.

Thanks,

Malhar


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [llvm-dev] Support for Range analysis in LLVM

Hal Finkel via llvm-dev
LLVM has two analyses that might do what you are looking for, check out
lib/Analysis/ValueTracking.cpp and lib/Analysis/LazyValueInfo.cpp.

John


On 6/6/17 11:54 AM, Jajoo, Malhar via llvm-dev wrote:

> Hi,
>
>
> I wish to compile something like -
>
>
> bits(4) UInt( bits(2) x )
>
> {
>
>      switch(b)
>
>      {
>
>           case 0:
>
>                return '0000';
>
>          case 1:
>
>                return '0001';
>
>          case 2 :
>
>               return '0010';
>
>          case 3:
>
>              return '0011';
>
>
>     }
>
> }
>
>
> int datasize = UInt(a);
>
>
>
> *My Question: Is there some way to perform Range Analysis over the
> function "UInt()" return value ?*
>
>
> It would be great if someone can help me out.
>
> Thanks,
>
> Malhar
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Loading...