[PATCH] D70318: Recover debug intrinsics when killing duplicate or empty basic blocks

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 06:57:45 PST 2019


jmorse added a comment.

NB, you'll also want to remove the DebugVariable portions of this patch and assign it as a child revision of D70486 <https://reviews.llvm.org/D70486>, and the tests went missing in the latest revision :o)

Adrian wrote:

> aprantl added a reviewer: jmorse.

Full disclosure, Stephen is also a Sony-ite, and I believe organisation-internal approves are generally frowned on. I'm happy with the general direction and implementation of this patch though.



================
Comment at: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:805-807
+	if (V->getType()->isVoidTy()) {
+		throw 0;
+  }
----------------
Something that accidentally snuck in?


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1050
+    while (DbgInfoIntrinsic *DI = dyn_cast<DbgInfoIntrinsic>(&BB->front())) {
+      if (auto DVI = cast<DbgVariableIntrinsic>(DI)) {
+        setDbgVariableUndef(DVI);
----------------
While building with this patch elsewhere I ran into some assertions, from isel observing dbg.declare's with Undef operands. This is actually great: it means that beforehand we weren't just losing dbg.values, but dbg.declares describing un-SROA'd/un-mem2reg'd locations too.

Those dbg.declares need to have their operands preserved rather than set to undef -- they're not control flow dependent, so it doesn't matters where they get placed (I think, 90%).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70318





More information about the llvm-commits mailing list