[PATCH] D21010: Replace the implementation of ConstantRange::binaryAnd.

John Regehr via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 01:37:09 PDT 2016


regehr added a comment.

Great to see some work going on here!

There is a known algorithm for solving these problems that is, I believe, both correct and precise. It's in Hacker's Delight (sorry, don't have my copy handy so can't give a page number). You can also find code here (and nearby):

https://github.com/sav-tools/wrapped-intervals/blob/master/lib/RangeAnalysis/BaseRange.cpp#L227

I think we should make sure to understand the relationship between this algorithm and Nick's code before committing to anything. I haven't fully grokked Nick's code yet but it looks like the proposed code may be more or less equivalent.


http://reviews.llvm.org/D21010





More information about the llvm-commits mailing list