diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-01 00:10:31 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-01 00:10:31 +0000 |
commit | 3872d0084c4f479020ce01b4db5d1bd414c57fb8 (patch) | |
tree | fd1a9e83666fa84a3916b46a94cca32978b34794 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 7c4fc4e5ae4c8145974397da295587e77c770f62 (diff) | |
download | bcm5719-llvm-3872d0084c4f479020ce01b4db5d1bd414c57fb8.tar.gz bcm5719-llvm-3872d0084c4f479020ce01b4db5d1bd414c57fb8.zip |
IR: MDNode => Value: Instruction::getMetadata()
Change `Instruction::getMetadata()` to return `Value` as part of
PR21433.
Update most callers to use `Instruction::getMDNode()`, which wraps the
result in a `cast_or_null<MDNode>`.
llvm-svn: 221024
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index da5ba0b8520..141f2e812e8 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -862,7 +862,7 @@ void computeKnownBits(Value *V, APInt &KnownZero, APInt &KnownOne, switch (I->getOpcode()) { default: break; case Instruction::Load: - if (MDNode *MD = cast<LoadInst>(I)->getMetadata(LLVMContext::MD_range)) + if (MDNode *MD = cast<LoadInst>(I)->getMDNode(LLVMContext::MD_range)) computeKnownBitsFromRangeMetadata(*MD, KnownZero); break; case Instruction::And: { @@ -1261,7 +1261,7 @@ void computeKnownBits(Value *V, APInt &KnownZero, APInt &KnownOne, } case Instruction::Call: case Instruction::Invoke: - if (MDNode *MD = cast<Instruction>(I)->getMetadata(LLVMContext::MD_range)) + if (MDNode *MD = cast<Instruction>(I)->getMDNode(LLVMContext::MD_range)) computeKnownBitsFromRangeMetadata(*MD, KnownZero); // If a range metadata is attached to this IntrinsicInst, intersect the // explicit range specified by the metadata and the implicit range of @@ -1536,7 +1536,7 @@ bool isKnownNonZero(Value *V, const DataLayout *TD, unsigned Depth, } if (Instruction* I = dyn_cast<Instruction>(V)) { - if (MDNode *Ranges = I->getMetadata(LLVMContext::MD_range)) { + if (MDNode *Ranges = I->getMDNode(LLVMContext::MD_range)) { // If the possible ranges don't contain zero, then the value is // definitely non-zero. if (IntegerType* Ty = dyn_cast<IntegerType>(V->getType())) { |