mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix Mem2Reg check on end_borrows of store_borrow
Instead of checking if the end_borrow is ending the lifetime of the store_borrow of the asi under consideration, this code was checking if the store_borrow source is the runningValue which is incorrect in cases where a store_borrow src to another destination gets replaced during mem2reg. This PR fixes the issue.
This commit is contained in:
@@ -1826,6 +1826,9 @@ void MemoryToRegisters::removeSingleBlockAllocation(AllocStackInst *asi) {
|
||||
if (!sbi) {
|
||||
continue;
|
||||
}
|
||||
if (sbi->getDest() != asi) {
|
||||
continue;
|
||||
}
|
||||
if (!runningVals.hasValue()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user