Postpone (expensive) escape analysis until we're sure it's needed.

This commit is contained in:
Frits van Bommel
2009-05-06 14:11:37 +02:00
parent c60ce29bde
commit c6b6d1874a

View File

@@ -167,10 +167,6 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) {
DEBUG(DOUT << "GarbageCollect2Stack inspecting: " << *Inst);
if (PointerMayBeCaptured(Inst, true)) {
continue;
}
Value* TypeInfo = CS.getArgument(info->TypeInfoArgNr);
const Type* Ty = getTypeFor(TypeInfo);
if (!Ty) {
@@ -203,6 +199,10 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) {
Ty = PtrTy->getElementType();
}
if (PointerMayBeCaptured(Inst, true)) {
continue;
}
// Let's alloca this!
Changed = true;