MCPcopy Create free account
hub / github.com/InoriRus/Kyty / PopulateLoopDesc

Method PopulateLoopDesc

source/3rdparty/vulkan/source/opt/loop_utils.cpp:640–670  ·  view source on GitHub ↗

Populates |new_loop| descriptor according to |old_loop|'s one.

Source from the content-addressed store, hash-verified

638
639// Populates |new_loop| descriptor according to |old_loop|'s one.
640void LoopUtils::PopulateLoopDesc(
641 Loop* new_loop, Loop* old_loop,
642 const LoopCloningResult& cloning_result) const {
643 for (uint32_t bb_id : old_loop->GetBlocks()) {
644 BasicBlock* bb = cloning_result.old_to_new_bb_.at(bb_id);
645 new_loop->AddBasicBlock(bb);
646 }
647 new_loop->SetHeaderBlock(
648 cloning_result.old_to_new_bb_.at(old_loop->GetHeaderBlock()->id()));
649 if (old_loop->GetLatchBlock())
650 new_loop->SetLatchBlock(
651 cloning_result.old_to_new_bb_.at(old_loop->GetLatchBlock()->id()));
652 if (old_loop->GetContinueBlock())
653 new_loop->SetContinueBlock(
654 cloning_result.old_to_new_bb_.at(old_loop->GetContinueBlock()->id()));
655 if (old_loop->GetMergeBlock()) {
656 auto it =
657 cloning_result.old_to_new_bb_.find(old_loop->GetMergeBlock()->id());
658 BasicBlock* bb = it != cloning_result.old_to_new_bb_.end()
659 ? it->second
660 : old_loop->GetMergeBlock();
661 new_loop->SetMergeBlock(bb);
662 }
663 if (old_loop->GetPreHeaderBlock()) {
664 auto it =
665 cloning_result.old_to_new_bb_.find(old_loop->GetPreHeaderBlock()->id());
666 if (it != cloning_result.old_to_new_bb_.end()) {
667 new_loop->SetPreHeaderBlock(it->second);
668 }
669 }
670}
671
672// Class to gather some metrics about a region of interest.
673void CodeMetrics::Analyze(const Loop& loop) {

Callers

nothing calls this directly

Calls 13

SetHeaderBlockMethod · 0.80
GetHeaderBlockMethod · 0.80
GetLatchBlockMethod · 0.80
SetLatchBlockMethod · 0.80
GetContinueBlockMethod · 0.80
SetContinueBlockMethod · 0.80
GetMergeBlockMethod · 0.80
SetMergeBlockMethod · 0.80
GetPreHeaderBlockMethod · 0.80
SetPreHeaderBlockMethod · 0.80
AddBasicBlockMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected