[ValueTracking] Extend range metadata to call/invoke
authorJingyue Wu <jingyue@google.com>
Thu, 19 Jun 2014 16:50:16 +0000 (16:50 +0000)
committerJingyue Wu <jingyue@google.com>
Thu, 19 Jun 2014 16:50:16 +0000 (16:50 +0000)
commite4d0a5ec1841ac5a407c3a07b62749923dda74c2
tree80d429db3108098a05f0e90408bcc280446602e8
parentb7509c63e9e5739ce2fec27579648df3ff2ac249
[ValueTracking] Extend range metadata to call/invoke

Summary:
With this patch, range metadata can be added to call/invoke including
IntrinsicInst. Previously, it could only be added to load.

Rename computeKnownBitsLoad to computeKnownBitsFromRangeMetadata because
range metadata is not only used by load.

Update the language reference to reflect this change.

Test Plan:
Add several tests in range-2.ll to confirm the verifier is happy with
having range metadata on call/invoke.

Add two tests in AddOverFlow.ll to confirm annotating range metadata to
call/invoke can benefit InstCombine.

Reviewers: meheff, nlewycky, reames, hfinkel, eliben

Reviewed By: eliben

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D4187

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211281 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.rst
include/llvm/Analysis/ValueTracking.h
lib/Analysis/ValueTracking.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/IR/Verifier.cpp
test/Transforms/InstCombine/AddOverFlow.ll
test/Transforms/InstCombine/add2.ll
test/Verifier/range-1.ll
test/Verifier/range-2.ll