Skip to content

Commit e50ff0f

Browse files
committed
EscapeAnalysis debugging: PrettyStackTrace for graph generation.
When ConnectionGraph merging triggers an assert, report which functions are being merged.
1 parent 1b0eee9 commit e50ff0f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/SILOptimizer/Analysis/EscapeAnalysis.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define DEBUG_TYPE "sil-escape"
1414
#include "swift/SILOptimizer/Analysis/EscapeAnalysis.h"
1515
#include "swift/SIL/DebugUtils.h"
16+
#include "swift/SIL/PrettyStackTrace.h"
1617
#include "swift/SIL/SILArgument.h"
1718
#include "swift/SILOptimizer/Analysis/ArraySemantic.h"
1819
#include "swift/SILOptimizer/Analysis/BasicCalleeAnalysis.h"
@@ -2345,6 +2346,8 @@ void EscapeAnalysis::recompute(FunctionInfo *Initial) {
23452346
LLVM_DEBUG(llvm::dbgs() << " create summary graph for "
23462347
<< FInfo->Graph.F->getName() << '\n');
23472348

2349+
PrettyStackTraceSILFunction
2350+
callerTraceRAII("merging escape summary", FInfo->Graph.F);
23482351
FInfo->Graph.propagateEscapeStates();
23492352

23502353
// Derive the summary graph of the current function. Even if the
@@ -2365,7 +2368,11 @@ void EscapeAnalysis::recompute(FunctionInfo *Initial) {
23652368

23662369
// Only include callers which we are actually recomputing.
23672370
if (BottomUpOrder.wasRecomputedWithCurrentUpdateID(E.Caller)) {
2368-
LLVM_DEBUG(llvm::dbgs() << " merge "
2371+
PrettyStackTraceSILFunction
2372+
calleeTraceRAII("merging escape graph", FInfo->Graph.F);
2373+
PrettyStackTraceSILFunction
2374+
callerTraceRAII("...into", E.Caller->Graph.F);
2375+
LLVM_DEBUG(llvm::dbgs() << " merge "
23692376
<< FInfo->Graph.F->getName()
23702377
<< " into "
23712378
<< E.Caller->Graph.F->getName() << '\n');

0 commit comments

Comments
 (0)