diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-10-23 21:23:18 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-10-23 21:23:18 +0000 |
commit | abd820a92bc82b5279c8cf87d54e89915414fedb (patch) | |
tree | c892262347eb0fa3cd97b7777087621d3f3677ae /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | edc3201b11bb7fcf9f8ccdfb72be506c41849978 (diff) | |
download | llvm-abd820a92bc82b5279c8cf87d54e89915414fedb.zip llvm-abd820a92bc82b5279c8cf87d54e89915414fedb.tar.gz llvm-abd820a92bc82b5279c8cf87d54e89915414fedb.tar.bz2 |
CGP: Clear data structures at the end of a loop iteration instead of the beginning.
Clearing LargeOffsetGEPMap at the end fixes a bug where if a large
offset GEP is in a dead basic block, we fail an assertion when trying
to delete the block due to the asserting VH in LargeOffsetGEPMap.
Differential Revision: https://reviews.llvm.org/D53464
llvm-svn: 345082
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index fa5cc4d..6e73f7d 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -436,11 +436,6 @@ bool CodeGenPrepare::runOnFunction(Function &F) { bool MadeChange = true; while (MadeChange) { MadeChange = false; - SeenChainsForSExt.clear(); - ValToSExtendedUses.clear(); - RemovedInsts.clear(); - LargeOffsetGEPMap.clear(); - LargeOffsetGEPID.clear(); for (Function::iterator I = F.begin(); I != F.end(); ) { BasicBlock *BB = &*I++; bool ModifiedDTOnIteration = false; @@ -460,6 +455,11 @@ bool CodeGenPrepare::runOnFunction(Function &F) { I->deleteValue(); EverMadeChange |= MadeChange; + SeenChainsForSExt.clear(); + ValToSExtendedUses.clear(); + RemovedInsts.clear(); + LargeOffsetGEPMap.clear(); + LargeOffsetGEPID.clear(); } SunkAddrs.clear(); |