Lines Matching refs:loop_info
73 static bool IsEarlyExit(HLoopInformation* loop_info) { in IsEarlyExit() argument
74 HBlocksInLoopReversePostOrderIterator it_loop(*loop_info); in IsEarlyExit()
77 if (!loop_info->Contains(*successor)) { in IsEarlyExit()
429 static void PeelByCount(HLoopInformation* loop_info, in PeelByCount() argument
434 LoopClonerSimpleHelper helper(loop_info, induction_range); in PeelByCount()
467 static bool HasLoopDiamondStructure(HLoopInformation* loop_info) { in HasLoopDiamondStructure() argument
468 HBasicBlock* header = loop_info->GetHeader(); in HasLoopDiamondStructure()
469 if (loop_info->NumberOfBackEdges() != 1 || header->GetSuccessors().size() != 2) { in HasLoopDiamondStructure()
474 HBasicBlock* diamond_top = loop_info->Contains(*header_succ_0) ? in HasLoopDiamondStructure()
491 back_edge != loop_info->GetBackEdges()[0]) { in HasLoopDiamondStructure()
495 DCHECK_EQ(loop_info->GetBlocks().NumSetBits(), 5u); in HasLoopDiamondStructure()
499 static bool IsPredicatedLoopControlFlowSupported(HLoopInformation* loop_info) { in IsPredicatedLoopControlFlowSupported() argument
500 size_t num_of_blocks = loop_info->GetBlocks().NumSetBits(); in IsPredicatedLoopControlFlowSupported()
501 return num_of_blocks == 2 || HasLoopDiamondStructure(loop_info); in IsPredicatedLoopControlFlowSupported()
619 void HLoopOptimization::AddLoop(HLoopInformation* loop_info) { in AddLoop() argument
620 DCHECK(loop_info != nullptr); in AddLoop()
621 LoopNode* node = new (loop_allocator_) LoopNode(loop_info); in AddLoop()
626 } else if (loop_info->IsIn(*last_loop_->loop_info)) { in AddLoop()
633 while (last_loop_->outer != nullptr && !loop_info->IsIn(*last_loop_->outer->loop_info)) { in AddLoop()
672 induction_range_.ReVisit(node->loop_info); in TraverseLoopsInnerToOuter()
724 for (HBlocksInLoopIterator it_loop(*node->loop_info); !it_loop.Done(); it_loop.Advance()) { in CalculateAndSetTryCatchKind()
767 HLoopInformation* loop_info = analysis_info->GetLoopInfo(); in TryToRemoveSuspendCheckFromLoopHeader() local
768 HBasicBlock* header = loop_info->GetHeader(); in TryToRemoveSuspendCheckFromLoopHeader()
784 HBasicBlock* header = node->loop_info->GetHeader(); in SimplifyInduction()
785 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in SimplifyInduction()
794 TryAssignLastValue(node->loop_info, phi, preheader, /*collect_loop_uses*/ false)) { in SimplifyInduction()
812 for (HBlocksInLoopIterator it(*node->loop_info); !it.Done(); it.Advance()) { in SimplifyBlocks()
852 static HBasicBlock* GetInnerLoopFiniteSingleExit(HLoopInformation* loop_info) { in GetInnerLoopFiniteSingleExit() argument
854 for (HBlocksInLoopIterator block_it(*loop_info); in GetInnerLoopFiniteSingleExit()
861 if (!loop_info->Contains(*successor)) { in GetInnerLoopFiniteSingleExit()
886 HBasicBlock* header = node->loop_info->GetHeader(); in TryOptimizeInnerLoopFinite()
887 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in TryOptimizeInnerLoopFinite()
890 if (!induction_range_.IsFinite(node->loop_info, &trip_count)) { in TryOptimizeInnerLoopFinite()
894 HBasicBlock* exit = GetInnerLoopFiniteSingleExit(node->loop_info); in TryOptimizeInnerLoopFinite()
912 TryAssignLastValue(node->loop_info, main_phi, preheader, /*collect_loop_uses*/ true)) { in TryOptimizeInnerLoopFinite()
953 if (!IsPredicatedLoopControlFlowSupported(node->loop_info) || in TryVectorizePredicated()
962 node->loop_info->GetBlocks().NumSetBits() != 2) { in TryVectorizePredicated()
977 HBasicBlock* header = node->loop_info->GetHeader(); in TryVectorizedTraditional()
1013 HLoopInformation* loop_info = analysis_info->GetLoopInfo(); in TryUnrollingForBranchPenaltyReduction() local
1014 LoopClonerSimpleHelper helper(loop_info, &induction_range_); in TryUnrollingForBranchPenaltyReduction()
1019 helper.GetBasicBlockMap()->Get(loop_info->GetHeader())->GetLastInstruction()->AsIf(); in TryUnrollingForBranchPenaltyReduction()
1020 int32_t constant = loop_info->Contains(*copy_hif->IfTrueSuccessor()) ? 1 : 0; in TryUnrollingForBranchPenaltyReduction()
1028 HLoopInformation* loop_info = analysis_info->GetLoopInfo(); in TryPeelingForLoopInvariantExitsElimination() local
1039 LoopClonerSimpleHelper helper(loop_info, &induction_range_); in TryPeelingForLoopInvariantExitsElimination()
1084 HLoopInformation* loop_info = analysis_info->GetLoopInfo(); in TryFullUnrolling() local
1085 PeelByCount(loop_info, trip_count, &induction_range_); in TryFullUnrolling()
1086 HIf* loop_hif = loop_info->GetHeader()->GetLastInstruction()->AsIf(); in TryFullUnrolling()
1087 int32_t constant = loop_info->Contains(*loop_hif->IfTrueSuccessor()) ? 0 : 1; in TryFullUnrolling()
1095 HLoopInformation* loop_info = node->loop_info; in TryLoopScalarOpts() local
1096 int64_t trip_count = LoopAnalysis::GetLoopTripCount(loop_info, &induction_range_); in TryLoopScalarOpts()
1097 LoopAnalysisInfo analysis_info(loop_info); in TryLoopScalarOpts()
1098 LoopAnalysis::CalculateLoopBasicProperties(loop_info, &analysis_info, trip_count); in TryLoopScalarOpts()
1118 if (!LoopClonerHelper::IsLoopClonable(loop_info)) { in TryLoopScalarOpts()
1267 HBasicBlock* header = node->loop_info->GetHeader(); in ShouldVectorizeCommon()
1268 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in ShouldVectorizeCommon()
1274 !TryAssignLastValue(node->loop_info, main_phi, preheader, /*collect_loop_uses*/ true)) { in ShouldVectorizeCommon()
1288 HBasicBlock* header = node->loop_info->GetHeader(); in VectorizePredicated()
1289 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in VectorizePredicated()
1306 HInstruction* stc = induction_range_.GenerateTripCount(node->loop_info, graph_, preheader); in VectorizePredicated()
1376 HBasicBlock* header = node->loop_info->GetHeader(); in VectorizeTraditional()
1377 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in VectorizeTraditional()
1439 HInstruction* stc = induction_range_.GenerateTripCount(node->loop_info, graph_, preheader); in VectorizeTraditional()
1522 HBasicBlock* header = node->loop_info->GetHeader(); in FinalizeVectorization()
1523 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in FinalizeVectorization()
1539 for (HBlocksInLoopPostOrderIterator it_loop(*node->loop_info); in FinalizeVectorization()
1543 if (cur_block == node->loop_info->GetHeader()) { in FinalizeVectorization()
1557 node->loop_info = vloop; in FinalizeVectorization()
1637 for (HBlocksInLoopIterator block_it(*node->loop_info); in GenerateNewLoopPredicated()
1677 HLoopInformation* loop_info = node->loop_info; in GenerateNewLoopBodyOnce() local
1680 for (HBlocksInLoopReversePostOrderIterator block_it(*loop_info); in GenerateNewLoopBodyOnce()
1685 if (cur_block == loop_info->GetHeader()) { in GenerateNewLoopBodyOnce()
1697 for (HBlocksInLoopReversePostOrderIterator block_it(*loop_info); in GenerateNewLoopBodyOnce()
1702 if (cur_block == loop_info->GetHeader()) { in GenerateNewLoopBodyOnce()
1761 node->loop_info->IsDefinedOutOfTheLoop(base) && in VectorizeDef()
1807 return !IsUsedOutsideLoop(node->loop_info, instruction) in VectorizeDef()
1825 if (node->loop_info->IsDefinedOutOfTheLoop(instruction)) { in VectorizeUse()
1847 node->loop_info->IsDefinedOutOfTheLoop(base) && in VectorizeUse()
2909 HLoopInformation* loop_info = phi->GetBlock()->GetLoopInformation(); in TrySetPhiReduction() local
2910 DCHECK(loop_info->Contains(*reduction->GetBlock())); in TrySetPhiReduction()
2918 [loop_info, reduction](const HUseListNode<HInstruction*>& use) { in TrySetPhiReduction()
2920 return user != reduction && loop_info->Contains(*user->GetBlock()); in TrySetPhiReduction()
2992 bool HLoopOptimization::IsUsedOutsideLoop(HLoopInformation* loop_info, in IsUsedOutsideLoop() argument
2996 if (use.GetUser()->GetBlock()->GetLoopInformation() != loop_info) { in IsUsedOutsideLoop()
3003 bool HLoopOptimization::IsOnlyUsedAfterLoop(HLoopInformation* loop_info, in IsOnlyUsedAfterLoop() argument
3011 if (loop_info->Contains(*user->GetBlock())) { in IsOnlyUsedAfterLoop()
3026 bool HLoopOptimization::TryReplaceWithLastValue(HLoopInformation* loop_info, in TryReplaceWithLastValue() argument
3042 CHECK(other_loop_info == nullptr || !other_loop_info->IsIn(*loop_info)); in TryReplaceWithLastValue()
3057 if (other_loop_info == nullptr || !other_loop_info->IsIn(*loop_info)) { in TryReplaceWithLastValue()
3069 bool HLoopOptimization::TryAssignLastValue(HLoopInformation* loop_info, in TryAssignLastValue() argument
3077 return IsOnlyUsedAfterLoop(loop_info, instruction, collect_loop_uses, &use_count) && in TryAssignLastValue()
3079 (!IsEarlyExit(loop_info) && TryReplaceWithLastValue(loop_info, instruction, block))); in TryAssignLastValue()
3110 HLoopInformation* loop_info = node->loop_info; in PreparePredicateInfoMap() local
3112 DCHECK(IsPredicatedLoopControlFlowSupported(loop_info)); in PreparePredicateInfoMap()
3114 for (HBlocksInLoopIterator block_it(*loop_info); in PreparePredicateInfoMap()
3126 HLoopInformation* loop_info = node->loop_info; in InitPredicateInfoMap() local
3127 HBasicBlock* header = loop_info->GetHeader(); in InitPredicateInfoMap()
3136 if (loop_info->Contains(*successor)) { in InitPredicateInfoMap()
3148 DCHECK(HasLoopDiamondStructure(loop_info)); in InitPredicateInfoMap()
3151 HBasicBlock* diamond_top = loop_info->Contains(*header_succ_0) ? in InitPredicateInfoMap()