[PATCH] D130153: [DRAFT] Don't create new memory accesses for dbg intrinsics in MemorySSA

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 01:55:56 PDT 2022


ChuanqiXu created this revision.
Herald added subscribers: asbirlea, george.burgess.iv, hiraditya.
Herald added a project: All.
ChuanqiXu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

After we landed https://reviews.llvm.org/D127383, the compiler may crash at: https://github.com/llvm/llvm-project/blob/051738b08cf5e39fd274dd379147d1c19e2b5b20/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp#L687-L691.

This is because the dbg intrinsics are readnone originally and the MemorySSA would refuse to create a new memory access at https://github.com/llvm/llvm-project/blob/051738b08cf5e39fd274dd379147d1c19e2b5b20/llvm/lib/Analysis/MemorySSA.cpp#L1830-L1831

But after D127383 <https://reviews.llvm.org/D127383>, it wouldn't be true for the dbg intrinsics in presplit coroutine. So here is the crash.


https://reviews.llvm.org/D130153

Files:
  llvm/lib/Analysis/MemorySSA.cpp


Index: llvm/lib/Analysis/MemorySSA.cpp
===================================================================
--- llvm/lib/Analysis/MemorySSA.cpp
+++ llvm/lib/Analysis/MemorySSA.cpp
@@ -1789,6 +1789,10 @@
     case Intrinsic::assume:
     case Intrinsic::experimental_noalias_scope_decl:
     case Intrinsic::pseudoprobe:
+    case Intrinsic::dbg_addr:
+    case Intrinsic::dbg_declare:
+    case Intrinsic::dbg_label:
+    case Intrinsic::dbg_value:
       return nullptr;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130153.446080.patch
Type: text/x-patch
Size: 483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220720/258c179c/attachment.bin>


More information about the llvm-commits mailing list