[PATCH] D100845: [Debugify][Original DI] Test preservation of original debug var intrinsics in optimizations

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 04:07:21 PDT 2021


StephenTozer added a comment.

This looks mostly good to me right now - I haven't gone through the HTML template code in-depth, but it looks to do what it says on the tin at least. I agree with the prior discussion that we will probably see a lot of false positives emerge from this, but I think the most important thing is that we have the tool. Once we have a larger spread of results, we can examine them and determine how best to tackle false positives so that we can get useful output.



================
Comment at: llvm/lib/Transforms/Utils/Debugify.cpp:331
+          // Skip undef values.
+          auto *Op = DVI->getVariableLocationOp(0);
+          if (isa_and_nonnull<UndefValue>(Op))
----------------
As of the current main, there is an `isUndef` function in DbgVariableIntrinsic that can be used for this check - though I've just noticed that it doesn't account for null operands, which is also something that should be handled in principle (since they aren't explicitly disallowed, and may be produced in a few places).


================
Comment at: llvm/lib/Transforms/Utils/Debugify.cpp:567
+          // Skip undef values.
+          auto *Op = DVI->getVariableLocationOp(0);
+          if (isa_and_nonnull<UndefValue>(Op))
----------------
`DVI->isUndef()` can be used instead, as in above comment.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100845/new/

https://reviews.llvm.org/D100845



More information about the llvm-commits mailing list