aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-03-04 02:06:53 +0000
committerDale Johannesen <dalej@apple.com>2009-03-04 02:06:53 +0000
commit9b121e3dc541abf5899fc5d38c61e3e6d07a99eb (patch)
tree4824edd349ed4273ad47fee3ddf647bc621e8a4f
parentc9612320aef934569c4f247a9f9699d5ec4557a2 (diff)
downloadexternal_llvm-9b121e3dc541abf5899fc5d38c61e3e6d07a99eb.zip
external_llvm-9b121e3dc541abf5899fc5d38c61e3e6d07a99eb.tar.gz
external_llvm-9b121e3dc541abf5899fc5d38c61e3e6d07a99eb.tar.bz2
Skip ptr-to-ptr bitcasts when counting in another case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66000 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/BasicBlockUtils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp
index fd7b7da..97460bf 100644
--- a/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -477,10 +477,10 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
Instruction *Inst = --ScanFrom;
if (isa<DbgInfoIntrinsic>(Inst))
continue;
- // Likewise, we skip bitcasts that feed into a llvm.dbg.declare; these are
- // not present when debugging is off.
- if (isa<BitCastInst>(Inst) && Inst->hasOneUse() &&
- isa<DbgDeclareInst>(Inst->use_begin()))
+ // We skip pointer-to-pointer bitcasts, which are NOPs.
+ // It is necessary for correctness to skip those that feed into a
+ // llvm.dbg.declare, as these are not present when debugging is off.
+ if (isa<BitCastInst>(Inst) && isa<PointerType>(Inst->getType()))
continue;
// Restore ScanFrom to expected value in case next test succeeds