MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / GetAllTopLevelRecurrences

Function GetAllTopLevelRecurrences

source/opt/loop_dependence.cpp:88–102  ·  view source on GitHub ↗

If |node| is an SERecurrentNode then returns |node| or if |node| is an SEAddNode returns a vector of SERecurrentNode that are its children.

Source from the content-addressed store, hash-verified

86// If |node| is an SERecurrentNode then returns |node| or if |node| is an
87// SEAddNode returns a vector of SERecurrentNode that are its children.
88std::vector<SERecurrentNode*> GetAllTopLevelRecurrences(SENode* node) {
89 auto nodes = std::vector<SERecurrentNode*>{};
90 if (auto recurrent_node = node->AsSERecurrentNode()) {
91 nodes.push_back(recurrent_node);
92 }
93
94 if (auto add_node = node->AsSEAddNode()) {
95 for (auto child : add_node->GetChildren()) {
96 auto child_nodes = GetAllTopLevelRecurrences(child);
97 nodes.insert(nodes.end(), child_nodes.begin(), child_nodes.end());
98 }
99 }
100
101 return nodes;
102}
103
104// If |node| is an SEConstantNode then returns |node| or if |node| is an
105// SEAddNode returns a vector of SEConstantNode that are its children.

Callers 1

GCDMIVTestMethod · 0.85

Calls 6

AsSERecurrentNodeMethod · 0.80
AsSEAddNodeMethod · 0.80
push_backMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected