summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 2887bdc46b5..fd7b7da76fb 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -477,6 +477,12 @@ 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()))
+ continue;
+
// Restore ScanFrom to expected value in case next test succeeds
ScanFrom++;
OpenPOWER on IntegriCloud