[+0 self][pin removal] Teach pinremoval how to use RCIdentityAnalysis when removing pins.

Previously, we were being very conservative and were not trying to look through
any RCId uses. Now we understand how to look through RCIdentical instructions to
pair a pin and unpin. We also understand how to use the new getRCUses API on
RCIdentityAnalysis to get all uses of a value, looking through RCIdentical
instructions.

I also added some code to COWArrayOpts to teach it how to look through enum insts (which I needed).

Additionally I got stuck and added support for automatic indentation in Debug
statements. This is better than having to indent by hand every time.

There were no significant perf changes since this code was not being emitted by
the frontend. But without this +0 self causes COW to break.

rdar://20267677

Swift SVN r26529
This commit is contained in:
Michael Gottesman
2015-03-25 06:21:11 +00:00
parent 5c3b4a8dfe
commit 254c784c94
5 changed files with 164 additions and 14 deletions

View File

@@ -48,6 +48,10 @@ public:
SILValue getRCIdentityRoot(SILValue V);
/// Return all recursive users of V, looking through users which
/// propagate RCIdentity.
void getRCUsers(SILValue V, llvm::SmallVectorImpl<SILInstruction *> &Users);
static bool classof(const SILAnalysis *S) {
return S->getKind() == AnalysisKind::RCIdentity;
}