Lines Matching refs:node
569 LoopNode* node = new (loop_allocator_) LoopNode(loop_info); in AddLoop() local
573 last_loop_ = top_loop_ = node; in AddLoop()
576 node->outer = last_loop_; in AddLoop()
578 last_loop_ = last_loop_->inner = node; in AddLoop()
584 node->outer = last_loop_->outer; in AddLoop()
585 node->previous = last_loop_; in AddLoop()
587 last_loop_ = last_loop_->next = node; in AddLoop()
591 void HLoopOptimization::RemoveLoop(LoopNode* node) { in RemoveLoop() argument
592 DCHECK(node != nullptr); in RemoveLoop()
593 DCHECK(node->inner == nullptr); in RemoveLoop()
594 if (node->previous != nullptr) { in RemoveLoop()
596 node->previous->next = node->next; in RemoveLoop()
597 if (node->next != nullptr) { in RemoveLoop()
598 node->next->previous = node->previous; in RemoveLoop()
602 if (node->outer != nullptr) { in RemoveLoop()
603 node->outer->inner = node->next; in RemoveLoop()
605 top_loop_ = node->next; in RemoveLoop()
607 if (node->next != nullptr) { in RemoveLoop()
608 node->next->outer = node->outer; in RemoveLoop()
609 node->next->previous = nullptr; in RemoveLoop()
614 bool HLoopOptimization::TraverseLoopsInnerToOuter(LoopNode* node) { in TraverseLoopsInnerToOuter() argument
616 for ( ; node != nullptr; node = node->next) { in TraverseLoopsInnerToOuter()
619 if (TraverseLoopsInnerToOuter(node->inner)) { in TraverseLoopsInnerToOuter()
620 induction_range_.ReVisit(node->loop_info); in TraverseLoopsInnerToOuter()
628 SimplifyInduction(node); in TraverseLoopsInnerToOuter()
629 SimplifyBlocks(node); in TraverseLoopsInnerToOuter()
633 if (node->inner == nullptr) { in TraverseLoopsInnerToOuter()
634 changed = OptimizeInnerLoop(node) || changed; in TraverseLoopsInnerToOuter()
644 void HLoopOptimization::SimplifyInduction(LoopNode* node) { in SimplifyInduction() argument
645 HBasicBlock* header = node->loop_info->GetHeader(); in SimplifyInduction()
646 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in SimplifyInduction()
655 TryAssignLastValue(node->loop_info, phi, preheader, /*collect_loop_uses*/ false)) { in SimplifyInduction()
671 void HLoopOptimization::SimplifyBlocks(LoopNode* node) { in SimplifyBlocks() argument
673 for (HBlocksInLoopIterator it(*node->loop_info); !it.Done(); it.Advance()) { in SimplifyBlocks()
708 bool HLoopOptimization::TryOptimizeInnerLoopFinite(LoopNode* node) { in TryOptimizeInnerLoopFinite() argument
709 HBasicBlock* header = node->loop_info->GetHeader(); in TryOptimizeInnerLoopFinite()
710 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in TryOptimizeInnerLoopFinite()
713 if (!induction_range_.IsFinite(node->loop_info, &trip_count)) { in TryOptimizeInnerLoopFinite()
718 for (HBlocksInLoopIterator it(*node->loop_info); !it.Done(); it.Advance()) { in TryOptimizeInnerLoopFinite()
746 TryAssignLastValue(node->loop_info, main_phi, preheader, /*collect_loop_uses*/ true)) { in TryOptimizeInnerLoopFinite()
761 RemoveLoop(node); // update hierarchy in TryOptimizeInnerLoopFinite()
773 ShouldVectorize(node, body, trip_count) && in TryOptimizeInnerLoopFinite()
774 TryAssignLastValue(node->loop_info, main_phi, preheader, /*collect_loop_uses*/ true)) { in TryOptimizeInnerLoopFinite()
775 Vectorize(node, body, exit, trip_count); in TryOptimizeInnerLoopFinite()
783 bool HLoopOptimization::OptimizeInnerLoop(LoopNode* node) { in OptimizeInnerLoop() argument
784 return TryOptimizeInnerLoopFinite(node) || TryPeelingAndUnrolling(node); in OptimizeInnerLoop()
890 bool HLoopOptimization::TryPeelingAndUnrolling(LoopNode* node) { in TryPeelingAndUnrolling() argument
891 HLoopInformation* loop_info = node->loop_info; in TryPeelingAndUnrolling()
923 bool HLoopOptimization::ShouldVectorize(LoopNode* node, HBasicBlock* block, int64_t trip_count) { in ShouldVectorize() argument
940 if (!VectorizeDef(node, it.Current(), /*generate_code*/ false)) { in ShouldVectorize()
1039 void HLoopOptimization::Vectorize(LoopNode* node, in Vectorize() argument
1043 HBasicBlock* header = node->loop_info->GetHeader(); in Vectorize()
1044 HBasicBlock* preheader = node->loop_info->GetPreHeader(); in Vectorize()
1106 HInstruction* stc = induction_range_.GenerateTripCount(node->loop_info, graph_, preheader); in Vectorize()
1147 GenerateNewLoop(node, in Vectorize()
1160 GenerateNewLoop(node, in Vectorize()
1174 GenerateNewLoop(node, in Vectorize()
1207 node->loop_info = vloop; in Vectorize()
1210 void HLoopOptimization::GenerateNewLoop(LoopNode* node, in GenerateNewLoop() argument
1240 bool vectorized_def = VectorizeDef(node, it.Current(), /*generate_code*/ true); in GenerateNewLoop()
1272 bool HLoopOptimization::VectorizeDef(LoopNode* node, in VectorizeDef() argument
1297 node->loop_info->IsDefinedOutOfTheLoop(base) && in VectorizeDef()
1299 VectorizeUse(node, value, generate_code, type, restrictions)) { in VectorizeDef()
1317 if (VectorizeSADIdiom(node, instruction, generate_code, type, restrictions) || in VectorizeDef()
1318 VectorizeDotProdIdiom(node, instruction, generate_code, type, restrictions) || in VectorizeDef()
1320 VectorizeUse(node, instruction, generate_code, type, restrictions))) { in VectorizeDef()
1336 return !IsUsedOutsideLoop(node->loop_info, instruction) in VectorizeDef()
1340 bool HLoopOptimization::VectorizeUse(LoopNode* node, in VectorizeUse() argument
1354 if (node->loop_info->IsDefinedOutOfTheLoop(instruction)) { in VectorizeUse()
1375 node->loop_info->IsDefinedOutOfTheLoop(base) && in VectorizeUse()
1416 VectorizeUse(node, opa, generate_code, type, restrictions | kNoHiBits)) || in VectorizeUse()
1419 VectorizeUse(node, opa, generate_code, type, restrictions))) { in VectorizeUse()
1435 VectorizeUse(node, opa, generate_code, from, restrictions)) { in VectorizeUse()
1446 if (VectorizeUse(node, opa, generate_code, type, restrictions)) { in VectorizeUse()
1463 if (VectorizeUse(node, opa, generate_code, type, restrictions) && in VectorizeUse()
1464 VectorizeUse(node, opb, generate_code, type, restrictions)) { in VectorizeUse()
1472 if (VectorizeHalvingAddIdiom(node, instruction, generate_code, type, restrictions)) { in VectorizeUse()
1501 if (VectorizeUse(node, r, generate_code, type, restrictions) && in VectorizeUse()
1528 if (VectorizeUse(node, r, generate_code, type, restrictions)) { in VectorizeUse()
1963 bool HLoopOptimization::VectorizeHalvingAddIdiom(LoopNode* node, in VectorizeHalvingAddIdiom() argument
2005 if (VectorizeUse(node, r, generate_code, type, restrictions) && in VectorizeHalvingAddIdiom()
2006 VectorizeUse(node, s, generate_code, type, restrictions)) { in VectorizeHalvingAddIdiom()
2035 bool HLoopOptimization::VectorizeSADIdiom(LoopNode* node, in VectorizeSADIdiom() argument
2080 if (VectorizeUse(node, acc, generate_code, sub_type, restrictions) && in VectorizeSADIdiom()
2081 VectorizeUse(node, r, generate_code, sub_type, restrictions) && in VectorizeSADIdiom()
2082 VectorizeUse(node, s, generate_code, sub_type, restrictions)) { in VectorizeSADIdiom()
2115 bool HLoopOptimization::VectorizeDotProdIdiom(LoopNode* node, in VectorizeDotProdIdiom() argument
2154 if (VectorizeUse(node, acc, generate_code, op_type, restrictions) && in VectorizeDotProdIdiom()
2155 VectorizeUse(node, r, generate_code, op_type, restrictions) && in VectorizeDotProdIdiom()
2156 VectorizeUse(node, s, generate_code, op_type, restrictions)) { in VectorizeDotProdIdiom()