mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CanonicalizeBorrowScope] Look through moves.
When encountering inside a borrow scope a non-lexical move_value or a move_value [lexical] where the borrowed value is itself already lexical, delete the move_value and regard its uses as uses of the moved-from value.
This commit is contained in:
@@ -78,9 +78,9 @@
|
||||
using namespace swift;
|
||||
using llvm::SmallSetVector;
|
||||
|
||||
llvm::Statistic swift::NumCopiesEliminated = {
|
||||
DEBUG_TYPE, "NumCopiesEliminated",
|
||||
"number of copy_value instructions removed"};
|
||||
llvm::Statistic swift::NumCopiesAndMovesEliminated = {
|
||||
DEBUG_TYPE, "NumCopiesAndMovesEliminated",
|
||||
"number of copy_value and move_value instructions removed"};
|
||||
|
||||
llvm::Statistic swift::NumCopiesGenerated = {
|
||||
DEBUG_TYPE, "NumCopiesGenerated",
|
||||
@@ -970,7 +970,7 @@ void CanonicalizeOSSALifetime::rewriteCopies() {
|
||||
} else {
|
||||
if (instsToDelete.insert(srcCopy)) {
|
||||
LLVM_DEBUG(llvm::dbgs() << " Removing " << *srcCopy);
|
||||
++NumCopiesEliminated;
|
||||
++NumCopiesAndMovesEliminated;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user