Revert "Disable generic specialization in the devirtualizer ..."

The problem was with the testcase that failed verification and not in the devirtualizer.

This reverts commit r25586.

Swift SVN r25594
This commit is contained in:
Nadav Rotem
2015-02-27 05:14:08 +00:00
parent 1d03915dfc
commit e7140012bf
2 changed files with 15 additions and 2 deletions

View File

@@ -652,6 +652,9 @@ public:
/// The entry point to the transformation.
void run() override {
/// A list of devirtualized calls.
GenericSpecializer::AIList DevirtualizedCalls;
bool Changed = false;
// Perform devirtualization locally and compute potential polymorphic
@@ -668,7 +671,8 @@ public:
if (!AI)
continue;
if (optimizeApplyInst(AI)) {
if (ApplyInst *NewAI = optimizeApplyInst(AI)) {
DevirtualizedCalls.push_back(NewAI);
Changed |= true;
}
}
@@ -677,6 +681,14 @@ public:
}
if (Changed) {
// Try to specialize the devirtualized calls.
auto GS = GenericSpecializer(getModule());
// Try to specialize the newly devirtualized calls.
if (GS.specialize(DevirtualizedCalls)) {
DEBUG(llvm::dbgs() << "Specialized some generic functions\n");
}
PM->scheduleAnotherIteration();
invalidateAnalysis(SILAnalysis::InvalidationKind::CallGraph);
}