mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Teach the new SROA to handle cases where an alloca that has already been
scheduled for processing on the worklist eventually gets deleted while we are processing another alloca, fixing the original test case in PR13990. To facilitate this, add a remove_if helper to the SetVector abstraction. It's not easy to use the standard abstractions for this because of the specifics of SetVectors types and implementation. Finally, a nice small test case is included. Thanks to Benjamin for the fantastic reduced test case here! All I had to do was delete some empty basic blocks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3302,7 +3302,11 @@ bool SROA::runOnFunction(Function &F) {
|
||||
while (!Worklist.empty()) {
|
||||
Changed |= runOnAlloca(*Worklist.pop_back_val());
|
||||
deleteDeadInstructions(DeletedAllocas);
|
||||
|
||||
// Remove the deleted allocas from various lists so that we don't try to
|
||||
// continue processing them.
|
||||
if (!DeletedAllocas.empty()) {
|
||||
Worklist.remove_if(IsAllocaInSet(DeletedAllocas));
|
||||
PromotableAllocas.erase(std::remove_if(PromotableAllocas.begin(),
|
||||
PromotableAllocas.end(),
|
||||
IsAllocaInSet(DeletedAllocas)),
|
||||
|
Reference in New Issue
Block a user