llvm.org GIT mirror llvm / 3091c92
RegionPrinter: Ignore back edges when layouting the graph git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126564 91177308-0d34-0410-b5e6-96231b3b80d8 Tobias Grosser 9 years ago
1 changed file(s) with 26 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
6969 G->getTopLevelRegion());
7070 }
7171
72 std::string getEdgeAttributes(RegionNode *srcNode,
73 GraphTraits::ChildIteratorType CI, RegionInfo *RI) {
74
75 RegionNode *destNode = *CI;
76
77 if (srcNode->isSubRegion() || destNode->isSubRegion())
78 return "";
79
80 // In case of a backedge, do not use it to define the layout of the nodes.
81 BasicBlock *srcBB = srcNode->getNodeAs();
82 BasicBlock *destBB = destNode->getNodeAs();
83
84 Region *R = RI->getRegionFor(destBB);
85
86 while (R && R->getParent())
87 if (R->getParent()->getEntry() == destBB)
88 R = R->getParent();
89 else
90 break;
91
92 if (R->getEntry() == destBB && R->contains(srcBB))
93 return "constraint=false";
94
95 return "";
96 }
97
7298 // Print the cluster of the subregions. This groups the single basic blocks
7399 // and adds a different background color for each group.
74100 static void printRegionCluster(const Region *R, GraphWriter &GW,