[llvm-commits] [llvm] r66000 - /llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
Dale Johannesen
dalej at apple.com
Tue Mar 3 18:06:55 PST 2009
Author: johannes
Date: Tue Mar 3 20:06:53 2009
New Revision: 66000
URL: http://llvm.org/viewvc/llvm-project?rev=66000&view=rev
Log:
Skip ptr-to-ptr bitcasts when counting in another case.
Modified:
llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=66000&r1=65999&r2=66000&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Tue Mar 3 20:06:53 2009
@@ -477,10 +477,10 @@
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
More information about the llvm-commits
mailing list