Revert "[sil-optimizer] Remove the opened archetypes related workarounds which are obsolete now."

This reverts commit 78683186f1.

It is related to 8ef8bb4eb1 which broke
swift_tools-RA_stdlib-RD_test-no_device and some others.
This commit is contained in:
Xin Tong
2016-06-22 18:15:38 -07:00
parent f52555ec82
commit 3dfa2ce40b
2 changed files with 20 additions and 0 deletions

View File

@@ -67,6 +67,19 @@ public:
if (II->isAllocatingStack() || II->isDeallocatingStack())
return false;
// We don't sink open_existential_* instructions, because
// there may be some instructions depending on them, e.g.
// metatype_inst, etc. But this kind of dependency
// cannot be expressed in SIL yet.
switch (II->getKind()) {
default: break;
case ValueKind::OpenExistentialBoxInst:
case ValueKind::OpenExistentialRefInst:
case ValueKind::OpenExistentialAddrInst:
case ValueKind::OpenExistentialMetatypeInst:
return false;
}
SILBasicBlock *CurrentBlock = II->getParent();
SILBasicBlock *Dest = nullptr;
unsigned InitialLoopDepth = LoopInfo->getLoopDepth(CurrentBlock);