Recommit r13291 with proper tests, etc.

Swift SVN r13304
This commit is contained in:
Michael Gottesman
2014-02-01 21:00:07 +00:00
parent 934e0756db
commit ebf12a9b9c
4 changed files with 102 additions and 0 deletions

View File

@@ -90,6 +90,11 @@ void promoteMemoryOperationsInBlock(SILBasicBlock *BB) {
if (isa<StrongRetainInst>(Inst))
continue;
if (auto *AI = dyn_cast<ApplyInst>(Inst))
if (auto *BI = dyn_cast<BuiltinFunctionRefInst>(&*AI->getCallee()))
if (isReadNone(BI))
continue;
// All other instructions that read from memory invalidate the store.
if (Inst->mayReadFromMemory())
PrevStore = 0;