[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)
commit37fcb5919d9c66bc29eeb8cffe2bb1773383b267
treeaf7c3de4b6be91c13709c5f84f03654446d1a06b
parent868832b3fd05e123c5db0f18c24151be276b0ec0
[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

llvm-svn: 211281
llvm/docs/LangRef.rst
llvm/include/llvm/Analysis/ValueTracking.h
llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/IR/Verifier.cpp
llvm/test/Transforms/InstCombine/AddOverFlow.ll
llvm/test/Transforms/InstCombine/add2.ll
llvm/test/Verifier/range-1.ll
llvm/test/Verifier/range-2.ll