summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorJingyue Wu <jingyue@google.com>2014-06-19 16:50:16 +0000
committerJingyue Wu <jingyue@google.com>2014-06-19 16:50:16 +0000
commit37fcb5919d9c66bc29eeb8cffe2bb1773383b267 (patch)
treeaf7c3de4b6be91c13709c5f84f03654446d1a06b /llvm/lib/IR/Verifier.cpp
parent868832b3fd05e123c5db0f18c24151be276b0ec0 (diff)
downloadbcm5719-llvm-37fcb5919d9c66bc29eeb8cffe2bb1773383b267.tar.gz
bcm5719-llvm-37fcb5919d9c66bc29eeb8cffe2bb1773383b267.zip
[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
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index d1c7f7d25c3..ad3c29c564e 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -2233,7 +2233,8 @@ void Verifier::visitInstruction(Instruction &I) {
}
MDNode *MD = I.getMetadata(LLVMContext::MD_range);
- Assert1(!MD || isa<LoadInst>(I), "Ranges are only for loads!", &I);
+ Assert1(!MD || isa<LoadInst>(I) || isa<CallInst>(I) || isa<InvokeInst>(I),
+ "Ranges are only for loads, calls and invokes!", &I);
InstsInThisBlock.insert(&I);
}
OpenPOWER on IntegriCloud