[llvm] 4ad8f7a - [Assignment Tracking][mem2reg] Remove overly defensive assert
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 10 01:57:25 PST 2023
Author: OCHyams
Date: 2023-02-10T09:57:05Z
New Revision: 4ad8f7a189570dc2560d0efdd05e6a8153313808
URL: https://github.com/llvm/llvm-project/commit/4ad8f7a189570dc2560d0efdd05e6a8153313808
DIFF: https://github.com/llvm/llvm-project/commit/4ad8f7a189570dc2560d0efdd05e6a8153313808.diff
LOG: [Assignment Tracking][mem2reg] Remove overly defensive assert
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
Added:
Modified:
llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 75ea9dc5dfc0..a90ae7703271 100644
--- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -121,10 +121,8 @@ class AssignmentTrackingInfo {
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.
More information about the llvm-commits
mailing list