Skip to content

Commit 928ea80

Browse files
committed
Merge commit eb8f379567e8 from llvm-project (by Florian Hahn):
[DSE] Remove malloc from EarliestEscapeInfo before removing. (#84157) Not removing the malloc from earliest escape info leaves stale entries in the cache. Fixes llvm/llvm-project#84051. PR: llvm/llvm-project#84157 This fixes a crash in clang (usually a bus error, but can also be another memory error) when compiling the science/siconos port. PR: 278174 Reported by: yuri MFC after: 3 days (cherry picked from commit aaabed1)
1 parent 2bfda18 commit 928ea80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,6 +1893,7 @@ struct DSEState {
18931893
Malloc->getArgOperand(0), IRB, TLI);
18941894
if (!Calloc)
18951895
return false;
1896+
18961897
MemorySSAUpdater Updater(&MSSA);
18971898
auto *LastDef =
18981899
cast<MemoryDef>(Updater.getMemorySSA()->getMemoryAccess(Malloc));
@@ -1901,9 +1902,8 @@ struct DSEState {
19011902
LastDef);
19021903
auto *NewAccessMD = cast<MemoryDef>(NewAccess);
19031904
Updater.insertDef(NewAccessMD, /*RenameUses=*/true);
1904-
Updater.removeMemoryAccess(Malloc);
19051905
Malloc->replaceAllUsesWith(Calloc);
1906-
Malloc->eraseFromParent();
1906+
deleteDeadInstruction(Malloc);
19071907
return true;
19081908
}
19091909

0 commit comments

Comments
 (0)