[llvm-commits] patch: improve instsimplify with non-recursive ranges

Nick Lewycky nlewycky at google.com
Thu Mar 3 12:04:12 PST 2011


Hi, I wrote a patch to InstSimplify to fix a TODO that I added while doing
other improvements in the same area. The attached patch matches "icmp pred
(binop x, CI2), CI" and uses some simple ConstantRange math to find the
cases this is always true or false.

It seems a little weird to me that we weren't already catching some of these
cases, and also that there isn't a utility method somewhere that produces a
ConstantRange given an instruction for me. Should I land this patch as-is,
then try to find pieces of instcombine (and others?) that are now redundant?
Should this code be factored out? Should I copy some of this logic into
LazyValueInfo?

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110303/80c807e9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inst-simplify-1.patch
Type: text/x-patch
Size: 4383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110303/80c807e9/attachment.bin>


More information about the llvm-commits mailing list