Now that
- owned arguments don't get lexical borrow scopes from SILGen
- owned arguments get lexical moves during inlining unless the value
passed for that argument is already lexical
- guaranteed arguments don't get lexical borrow scopes during inlining
when the value passed for that argument is already lexical
tests involving owned argument emission from SILGen and inlining need to
be updated.
Previously, hoisting was done over applies that were users of the
borrowed value. Here, that is no longer done.
That hoisting was done on the theory that multiple distinct lexical
scopes were equivalent to a single enclosing lexical scope. Dead borrow
elimination, however, means that they are not in fact the same, however:
If a callee takes an object as an argument, and in that callee that
argument is dead, FSO and inliniing (even with approaches to maintain
lexical borrow scopes when the value that is borrowed comes from an
owned argument) can result in a dead borrow scope in the caller which
could then be eliminated which would then enable the destroy_value
to be hoisted over the inlined body, including over barriers.
The new file tests the -O pipeline up to just before OSSA lowering. It
will be used for verifying the effects of ShrinkBorrowScope on swift
code directly, to complement the tests done on SIL by just running a
single pass.