introduce a new helper to SILBuilder that emits a StrongRelease operation,

scanning up the local block to see if it immediately cancels a retain 
operation.

Use this in mandatory inlining to zap more retains and release.  Before
this patch, the result LogicValue allocation blocked this optimization,
preventing the partial_apply from being deleted from the case in 
rdar://15328833.




Swift SVN r10447
This commit is contained in:
Chris Lattner
2013-11-14 01:50:28 +00:00
parent 34f5e43b09
commit b2ac1db9f6
4 changed files with 92 additions and 13 deletions

View File

@@ -764,6 +764,12 @@ public:
/// generate an explicit one if that fails.
void emitDestroyAddr(SILLocation Loc, SILValue Operand);
/// Perform a strong_release instruction at the current location, attempting
/// to fold it locally into nearby retain instructions or emitting an explicit
/// strong release if necessary. If this inserts a new instruction, it
/// returns it, otherwise it returns null.
StrongReleaseInst *emitStrongRelease(SILLocation Loc, SILValue Operand);
/// Convenience function for calling emitRetain on the type lowering
/// for the non-address value.
SILValue emitCopyValueOperation(SILLocation loc, SILValue v) {