summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
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
commitd71c20081c7769b6e65b8733b4f593d8ee7f21f8 (patch)
treec8bad69681276af24cd2c996f442ec0d61a3a0fb /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parentc8b5a6ef7d2e4212db9d6d0866474d47deb7172a (diff)
downloadbcm5719-llvm-d71c20081c7769b6e65b8733b4f593d8ee7f21f8.tar.gz
bcm5719-llvm-d71c20081c7769b6e65b8733b4f593d8ee7f21f8.zip
Skip ptr-to-ptr bitcasts when counting in another case.
llvm-svn: 66000
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index fd7b7da76fb..97460bf1add 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud