Skip to content

Commit 3e47fe2

Browse files
committed
[region-isolation] Change printing of values before dataflow to dump the full value state of the value instead of just the representative.
Just makes it easier to debug. (cherry picked from commit b19081d)
1 parent 345b65a commit 3e47fe2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/swift/SILOptimizer/Analysis/RegionAnalysis.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ class regionanalysisimpl::TrackableValue {
286286
bool isTransferringParameter() const;
287287

288288
void print(llvm::raw_ostream &os) const {
289+
os << "TrackableValue. State: ";
290+
valueState.print(os);
291+
os << "\n Rep Value: ";
292+
getRepresentative().print(os);
293+
}
294+
295+
void printVerbose(llvm::raw_ostream &os) const {
289296
os << "TrackableValue. State: ";
290297
valueState.print(os);
291298
os << "\n Rep Value: " << getRepresentative();

lib/SILOptimizer/Analysis/RegionAnalysis.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3460,7 +3460,9 @@ void RegionAnalysisValueMap::print(llvm::raw_ostream &os) const {
34603460
}
34613461
std::sort(temp.begin(), temp.end());
34623462
for (auto p : temp) {
3463-
os << "%%" << p.first << ": " << p.second;
3463+
os << "%%" << p.first << ": ";
3464+
auto value = getValueForId(Element(p.first));
3465+
value->print(os);
34643466
}
34653467
#endif
34663468
}

0 commit comments

Comments
 (0)