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

Method AddLoopNest

source/opt/loop_descriptor.cpp:987–1000  ·  view source on GitHub ↗

Adds a new loop nest to the descriptor set.

Source from the content-addressed store, hash-verified

985
986// Adds a new loop nest to the descriptor set.
987Loop* LoopDescriptor::AddLoopNest(std::unique_ptr<Loop> new_loop) {
988 Loop* loop = new_loop.release();
989 if (!loop->HasParent()) placeholder_top_loop_.nested_loops_.push_back(loop);
990 // Iterate from inner to outer most loop, adding basic block to loop mapping
991 // as we go.
992 for (Loop& current_loop :
993 make_range(iterator::begin(loop), iterator::end(nullptr))) {
994 loops_.push_back(&current_loop);
995 for (uint32_t bb_id : current_loop.GetBlocks())
996 basic_block_to_loop_.insert(std::make_pair(bb_id, &current_loop));
997 }
998
999 return loop;
1000}
1001
1002void LoopDescriptor::RemoveLoop(Loop* loop) {
1003 Loop* parent = loop->GetParent() ? loop->GetParent() : &placeholder_top_loop_;

Callers 1

PopulateLoopNestMethod · 0.80

Calls 4

make_rangeFunction · 0.85
HasParentMethod · 0.80
push_backMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected