[PATCH] D71620: [Attributor][WIP] AAValueConstantRange: Value range analysis using constant range

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 10:46:24 PST 2019


uenoku created this revision.
uenoku added reviewers: jdoerfert, sstefan1.
Herald added subscribers: llvm-commits, javed.absar, hiraditya.
Herald added a project: LLVM.

This patch introduces `AAValueConstantRange`, which answers a possible range for integer value in a specific program point. 
One of the motivations is propagating existing `range` metadata. (I think we need to change the situation that `range` metadata cannot be put to Argument).

The state is a tuple of `ConstantRange` and it is initialized to (known, assumed) = ([-∞, +∞], empty).

Supported

- BinaryOperator(add, sub, ...)
- CmpInst(icmp eq, ...)
- !range metadata

Unsupported

- Use context-and flow-sensitive information
- Loop (ex. idx = phi [0, %header] [%idx + 1,  %body] ) to avoid the extensive increase of iterations. I think using SCEV in `initliaze` and change known state will be a good solution

`AAValueConstantRange` is not indented to extend to polyhedral range value analysis.

NOTE: Some test changes are missing. I'll add later.


https://reviews.llvm.org/D71620

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll
  llvm/test/Transforms/Attributor/value-simplify.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71620.234336.patch
Type: text/x-patch
Size: 23167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191217/b667c5e2/attachment.bin>


More information about the llvm-commits mailing list