[PATCH] D59668: [ValueTracking] Take signedness into account for and/or ranges

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 14:23:14 PDT 2019


nikic created this revision.
nikic added reviewers: lebedev.ri, spatel.
Herald added subscribers: llvm-commits, jdoerfert, hiraditya.
Herald added a project: LLVM.

While trying to extend D59386 <https://reviews.llvm.org/D59386> to signed add/sub I ran into quite a few issues ... unfortunately our range handling is quite biased in favor of unsigned ranges right now and it'll be necessary to thread preferred signedness through various APIs to get reasonable results.

This is the first step in this direction. computeConstantRange() gets a preferred signedness flag, which is respected for and/or range calculations. InstSimplify calls computeConstantRange() with the signedness of the predicate. This allows us to simplify signed icmps of and/or in InstSimplify.


Repository:
  rL LLVM

https://reviews.llvm.org/D59668

Files:
  llvm/include/llvm/Analysis/ValueTracking.h
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/test/Transforms/InstSimplify/icmp-constant.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59668.191779.patch
Type: text/x-patch
Size: 5864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/ba984d48/attachment.bin>


More information about the llvm-commits mailing list