From: Dale Johannesen Date: Wed, 4 Mar 2009 02:06:53 +0000 (+0000) Subject: Skip ptr-to-ptr bitcasts when counting in another case. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d9c05d7711b65bca070da76cb0e9a9b9eb7e69d5;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index fd7b7da76fb..97460bf1add 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(Inst)) continue; - // Likewise, we skip bitcasts that feed into a llvm.dbg.declare; these are - // not present when debugging is off. - if (isa(Inst) && Inst->hasOneUse() && - isa(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(Inst) && isa(Inst->getType())) continue; // Restore ScanFrom to expected value in case next test succeeds