-
Enhancement
-
Resolution: Unresolved
-
P4
-
17, 18
I think grow_traces and merge_traces actually do the same thing, their purpose is to extend the trace as long as possible, only the strategy of selecting those traces to be extended is different. The current implementation traverses all CFG edges three times, I think we can achieve it in two (or even one) times.
```
// Grow traces at their ends via most frequent edges.
grow_traces();
// Merge one trace into another, but only at fall-through points.
// This may make diamonds and other related shapes in a trace.
merge_traces(true);
// Run merge again, allowing two traces to be catenated, even if
// one does not fall through into the other. This appends loosely
// related traces to be near each other.
merge_traces(false);
```
```
// Grow traces at their ends via most frequent edges.
grow_traces();
// Merge one trace into another, but only at fall-through points.
// This may make diamonds and other related shapes in a trace.
merge_traces(true);
// Run merge again, allowing two traces to be catenated, even if
// one does not fall through into the other. This appends loosely
// related traces to be near each other.
merge_traces(false);
```