[Assignment Tracking][mem2reg] Remove overly defensive assert
authorOCHyams <orlando.hyams@sony.com>
Fri, 10 Feb 2023 09:27:37 +0000 (09:27 +0000)
committerOCHyams <orlando.hyams@sony.com>
Fri, 10 Feb 2023 09:57:05 +0000 (09:57 +0000)
The assert fires if a store to an alloca with no linked dbg.assigns has linked
dbg.assigns. This can happen in the wild due to optimisations dropping the
alloca's debug info so we shouldn't assert against it.

Reviewed By: jryans

Differential Revision: https://reviews.llvm.org/D143153

llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp

index 75ea9dc..a90ae77 100644 (file)
@@ -121,10 +121,8 @@ public:
   void updateForDeletedStore(StoreInst *ToDelete, DIBuilder &DIB) const {
     // There's nothing to do if the alloca doesn't have any variables using
     // assignment tracking.
-    if (DbgAssigns.empty()) {
-      assert(at::getAssignmentMarkers(ToDelete).empty());
+    if (DbgAssigns.empty())
       return;
-    }
 
     // Just leave dbg.assign intrinsics in place and remember that we've seen
     // one for each variable fragment.