[PATCH] D30701: [LoopRotate] Fix for dbg.value propagation

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 02:03:46 PST 2017


samparker added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:186
     if (auto DbgII = dyn_cast<DbgInfoIntrinsic>(&I)) {
-      if (isa<PHINode>(DbgII->getVariableLocation()))
-        DbgValueMap.insert({DbgII->getVariableLocation(), DbgII});
+      if (auto Loc = dyn_cast<PHINode>(DbgII->getVariableLocation()))
+        DbgValueMap.insert({Loc, DbgII});
----------------
aprantl wrote:
> I think you still want a dyn_cast_or_null here. Optimizations sometimes delete an llvm::Value without deleting debug intrinsics pointing to it.
Yes, thank you!


https://reviews.llvm.org/D30701





More information about the llvm-commits mailing list