Jajoo, Malhar via llvm-dev
2017-Jun-06 17:54 UTC
[llvm-dev] Support for Range analysis in LLVM
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170606/3d8563f2/attachment.html>
John Regehr via llvm-dev
2017-Jun-06 21:31 UTC
[llvm-dev] Support for Range analysis in LLVM
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 > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >