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

Method PartiallyUnroll

source/opt/loop_unroller.cpp:1016–1023  ·  view source on GitHub ↗

Duplicate the |loop| body |factor| number of times while keeping the loop backedge intact.

Source from the content-addressed store, hash-verified

1014// Duplicate the |loop| body |factor| number of times while keeping the loop
1015// backedge intact.
1016bool LoopUnrollerUtilsImpl::PartiallyUnroll(Loop* loop, size_t factor) {
1017 if (!Unroll(loop, factor)) return false;
1018 LinkLastPhisToStart(loop);
1019 AddBlocksToLoop(loop);
1020 AddBlocksToFunction(loop->GetMergeBlock());
1021 RemoveDeadInstructions();
1022 return true;
1023}
1024
1025/*
1026 * End LoopUtilsImpl.

Callers 4

ProcessMethod · 0.80
ProcessMethod · 0.80
TEST_FFunction · 0.80
ProcessMethod · 0.80

Calls 7

GetMergeBlockMethod · 0.80
InitMethod · 0.80
GetLoopIterationCountMethod · 0.80
FullyUnrollMethod · 0.80
GetParentMethod · 0.45
GetHeaderBlockMethod · 0.45

Tested by

no test coverage detected