| /arkcompiler/runtime_core/compiler/optimizer/analysis/ |
| D | dominators_tree.h | 46 static void SetDomPair(BasicBlock *dominator, BasicBlock *block); 52 * The ancestor of 'block', nullptr for the tree root 54 void SetAncestor(BasicBlock *dest, BasicBlock *block) in SetAncestor() argument 56 (*ancestors_)[GetBlockId(dest)] = block; in SetAncestor() 58 BasicBlock *GetAncestor(BasicBlock *block) const in GetAncestor() argument 60 return (*ancestors_)[GetBlockId(block)]; in GetAncestor() 64 * A set of blocks whose semidominator is 'block' 66 BlocksVector &GetBucket(BasicBlock *block) in GetBucket() argument 68 return (*buckets_)[GetBlockId(block)]; in GetBucket() 72 * The immediate dominator of 'block' [all …]
|
| D | dominators_tree.cpp | 26 for (auto block : GetGraph()->GetBlocksRPO()) { in RunImpl() local 27 block->ClearDominatedBlocks(); in RunImpl() 28 block->ClearDominator(); in RunImpl() 34 …SERT_PRINT(dfs_blocks == (GetGraph()->GetBlocksRPO().size() - 1), "There is an unreachable block"); in RunImpl() 48 * Update dominator information for 'block' 50 void DominatorsTree::AdjustImmediateDominators(BasicBlock *block) in AdjustImmediateDominators() argument 52 ASSERT(block != nullptr); in AdjustImmediateDominators() 54 if (GetIdom(block) != GetVertex(GetSemi(block))) { in AdjustImmediateDominators() 55 SetIdom(block, GetIdom(GetIdom(block))); in AdjustImmediateDominators() 57 SetDomPair(GetIdom(block), block); in AdjustImmediateDominators() [all …]
|
| D | loop_analyzer.cpp | 39 for (auto block : GetGraph()->GetVectorBlocks()) { in ResetLoopInfo() local 40 if (block != nullptr) { in ResetLoopInfo() 41 block->SetLoop(nullptr); in ResetLoopInfo() 76 * When a block is visited for the first time it is marked with a gray marker, 77 * after visiting all his successors, a block is marked with a black marker. 78 * While doing DFS, if we encounter a block with a gray mark, then edge to this block is back edge. 80 void LoopAnalyzer::BackEdgeSearch(BasicBlock *block) in BackEdgeSearch() argument 82 block->SetMarker(gray_marker_); in BackEdgeSearch() 83 block->SetMarker(black_marker_); in BackEdgeSearch() 84 for (auto succ : block->GetSuccsBlocks()) { in BackEdgeSearch() [all …]
|
| D | liveness_analyzer.cpp | 78 * - all dominators of a block are visiting before this block; 96 ASSERT_PRINT(CheckLinearOrder(), "Linear block order isn't correct"); in BuildBlocksLinearOrder() 103 * Check if all forward edges of loop header were visited to get the resulting block order in RPO. 106 bool LivenessAnalyzer::AllForwardEdgesVisited(BasicBlock *block) in AllForwardEdgesVisited() argument 108 if (!block->IsLoopHeader()) { in AllForwardEdgesVisited() 109 for (auto pred : block->GetPredsBlocks()) { in AllForwardEdgesVisited() 116 if (block->GetLoop()->IsIrreducible()) { in AllForwardEdgesVisited() 120 for (auto pred : block->GetPredsBlocks()) { in AllForwardEdgesVisited() 121 if (!block->IsDominate(pred) && !pred->IsMarked(marker_)) { in AllForwardEdgesVisited() 143 // Each block is inserted into pending list before all already inserted blocks in LinearizeBlocks() [all …]
|
| D | linear_order.cpp | 52 void LinearOrder::HandlePrevInstruction(BasicBlock *block, BasicBlock *prev_block) in HandlePrevInstruction() argument 54 ASSERT(block != nullptr && prev_block != nullptr); in HandlePrevInstruction() 64 HandleIfBlock(prev_block, block); in HandlePrevInstruction() 72 … if (block != prev_block->GetSuccessor(0) && !prev_block->GetLastInst()->IsControlFlow()) { in HandlePrevInstruction() 77 } else if (!prev_block->IsEndBlock() && block != prev_block->GetSuccessor(0) && in HandlePrevInstruction() 115 for (auto block : blocks) { in MakeLinearOrder() local 117 HandlePrevInstruction(block, prev); in MakeLinearOrder() 119 linear_blocks_.push_back(block); in MakeLinearOrder() 120 prev = block; in MakeLinearOrder() 124 // Handle last block in MakeLinearOrder() [all …]
|
| D | loop_analyzer.h | 62 void AppendBackEdge(BasicBlock *block) in AppendBackEdge() argument 64 ASSERT(std::find(back_edges_.begin(), back_edges_.end(), block) == back_edges_.end()); in AppendBackEdge() 65 back_edges_.push_back(block); in AppendBackEdge() 68 void ReplaceBackEdge(BasicBlock *block, BasicBlock *new_block) in ReplaceBackEdge() argument 70 ASSERT(block != new_block); in ReplaceBackEdge() 72 auto it = std::find(back_edges_.begin(), back_edges_.end(), block); in ReplaceBackEdge() 74 ASSERT(std::find(it + 1, back_edges_.end(), block) == back_edges_.end()); in ReplaceBackEdge() 78 bool HasBackEdge(BasicBlock *block) const in HasBackEdge() argument 80 auto it = std::find(back_edges_.begin(), back_edges_.end(), block); in HasBackEdge() 84 void RemoveBackEdge(BasicBlock *block) in RemoveBackEdge() argument [all …]
|
| D | bounds_analysis.cpp | 360 BoundsRange BoundsRangeInfo::FindBoundsRange(const BasicBlock *block, Inst *inst) const in FindBoundsRange() argument 362 ASSERT(block != nullptr && inst != nullptr); in FindBoundsRange() 373 while (block != nullptr) { in FindBoundsRange() 374 if (bounds_range_info_.find(block) != bounds_range_info_.end() && in FindBoundsRange() 375 bounds_range_info_.at(block).find(inst) != bounds_range_info_.at(block).end()) { in FindBoundsRange() 376 return bounds_range_info_.at(block).at(inst); in FindBoundsRange() 378 block = block->GetDominator(); in FindBoundsRange() 389 void BoundsRangeInfo::SetBoundsRange(const BasicBlock *block, const Inst *inst, BoundsRange range) in SetBoundsRange() argument 402 if (bounds_range_info_.find(block) == bounds_range_info_.end()) { in SetBoundsRange() 403 auto it1 = bounds_range_info_.emplace(block, aa_.Adapter()); in SetBoundsRange() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/ir/ |
| D | graph.cpp | 34 static void MarkBlocksRec(Marker mrk, BasicBlock *block) in MarkBlocksRec() argument 36 if (block->SetMarker(mrk)) { in MarkBlocksRec() 39 for (auto succ : block->GetSuccsBlocks()) { in MarkBlocksRec() 131 void Graph::AddBlock(BasicBlock *block) in AddBlock() argument 133 block->SetId(vector_bb_.size()); in AddBlock() 134 vector_bb_.push_back(block); in AddBlock() 135 block->SetGraph(this); in AddBlock() 140 void Graph::AddBlock(BasicBlock *block, uint32_t id) in AddBlock() argument 143 // (id + 1) for adding a block with index 0 in AddBlock() 147 block->SetId(id); in AddBlock() [all …]
|
| D | graph_cloner.h | 69 BasicBlock *CloneLoopHeader(BasicBlock *block, BasicBlock *outer, BasicBlock *replaceable_pred); 84 * \--->[outside-block] 103 * | [resolver-block]<----/ 106 * \--->[outside-block] 123 * \--->[outside-block] 176 …void BuildClonedLoopHeaderDataFlow(const BasicBlock &block, BasicBlock *resolver, BasicBlock *clon… 179 bool HasClone(const BasicBlock *block) in HasClone() argument 181 … return (block->GetId() < clone_blocks_.size()) && (clone_blocks_[block->GetId()] != nullptr); in HasClone() 184 BasicBlock *GetClone(const BasicBlock *block) in GetClone() argument 186 ASSERT(block != nullptr); in GetClone() [all …]
|
| D | basicblock.h | 136 // Get index of the given block in predecessor container 137 size_t GetPredBlockIndex(const BasicBlock *block) const in GetPredBlockIndex() argument 139 auto it = std::find(preds_.begin(), preds_.end(), block); in GetPredBlockIndex() 141 ASSERT(std::find(it + 1, preds_.end(), block) == preds_.end()); in GetPredBlockIndex() 145 // Get index of the given block in successor container 146 size_t GetSuccBlockIndex(const BasicBlock *block) const in GetSuccBlockIndex() argument 148 auto it = std::find(succs_.begin(), succs_.end(), block); in GetSuccBlockIndex() 150 ASSERT(std::find(it + 1, succs_.end(), block) == succs_.end()); in GetSuccBlockIndex() 154 // Get basic block by its index in predecessors container 188 …* Split block after the given instruction. Current block will contain instructions before the spli… [all …]
|
| D | graph_cloner.cpp | 62 for (auto block : GetGraph()->GetBlocksRPO()) { in CloneAnalyses() local 63 auto clone = GetClone(block); in CloneAnalyses() 64 if (block->GetDominator() != nullptr) { in CloneAnalyses() 65 auto clone_dom = GetClone(block->GetDominator()); in CloneAnalyses() 68 for (auto dom_blocks : block->GetDominatedBlocks()) { in CloneAnalyses() 98 for (auto block : loop->GetBlocks()) { in CopyLoop() local 99 if (block->IsLoopHeader()) { in CopyLoop() 102 cloned_loop->AppendBlock(GetClone(block)); in CopyLoop() 128 for (auto block : GetGraph()->GetBlocksLinearOrder()) { in CloneLinearOrder() local 129 clone_linear_blocks.push_back(GetClone(block)); in CloneLinearOrder() [all …]
|
| D | graph_checker.cpp | 44 for (auto block : graph->GetVectorBlocks()) { in UserInputCheck() local 45 if (block == nullptr) { in UserInputCheck() 48 for (auto inst : block->AllInsts()) { in UserInputCheck() 103 for (auto block : GetGraph()->GetVectorBlocks()) { in Check() local 105 if (block == nullptr) { in Check() 108 ASSERT_PRINT(block->GetGraph() == GetGraph(), "Block linked to incorrect graph"); in Check() 109 … ASSERT_PRINT(block->GetId() == blocks_id, "Block ID must be equal to its ID in graph vector"); in Check() 110 CheckBlock(block); in Check() 113 ASSERT_PRINT(blocks_count == GetGraph()->GetBlocksRPO().size(), "There is disconnected block"); in Check() 138 void GraphChecker::CheckBlock([[maybe_unused]] BasicBlock *block) in CheckBlock() argument [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/optimizations/ |
| D | deoptimize_elimination.cpp | 39 auto block = inst->GetBasicBlock(); in ReplaceDeoptimizeIfByUnconditionalDeoptimize() local 40 if (block != nullptr) { in ReplaceDeoptimizeIfByUnconditionalDeoptimize() 41 block->ReplaceInstByDeoptimize(inst); in ReplaceDeoptimizeIfByUnconditionalDeoptimize() 49 auto block = GetGraph()->GetStartBlock(); in RemoveSafePoints() local 50 ASSERT(block != nullptr && block->IsStartBlock()); in RemoveSafePoints() 51 for (auto sp : block->Insts()) { in RemoveSafePoints() 55 …PILER_LOG(DEBUG, DEOPTIMIZE_ELIM) << "SafePoint " << sp->GetId() << " is deleted from start block"; in RemoveSafePoints() 56 … block->GetGraph()->GetEventWriter().EventDeoptimizeElimination(GetOpcodeString(sp->GetOpcode()), in RemoveSafePoints() 136 auto block = inst->GetBasicBlock(); in VisitDeoptimizeIf() local 137 auto graph = block->GetGraph(); in VisitDeoptimizeIf() [all …]
|
| D | code_sink.cpp | 56 * - Loads that may be aliased by following stores in a basic block 65 // sunk to it's basic block dominatee. Iterate sinking until no changes in RunImpl() 71 for (auto block : GetGraph()->GetBlocksRPO()) { in RunImpl() local 72 changed |= ProcessBlock(block); in RunImpl() 84 // Bounds analysis works with instructions in a particular basic block in InvalidateAnalyses() 92 * If instruction can be sunk, it is erased from it's basic block and inserted 95 bool CodeSink::ProcessBlock(BasicBlock *block) in ProcessBlock() argument 97 if (block->IsStartBlock() || block->IsEndBlock()) { in ProcessBlock() 103 for (auto inst : block->InstsSafeReverse()) { in ProcessBlock() 116 GetGraph()->GetEventWriter().EventCodeSink(inst->GetId(), inst->GetPc(), block->GetId(), in ProcessBlock() [all …]
|
| D | try_catch_resolving.cpp | 32 for (auto block : GetGraph()->GetBlocksRPO()) { in RunImpl() local 33 if (!block->IsTryBegin()) { in RunImpl() 36 …COMPILER_LOG(DEBUG, TRY_CATCH_RESOLVING) << "Visit try-begin id = " << std::to_string(block->GetId… in RunImpl() 37 VisitTry(GetTryBeginInst(block)); in RunImpl() 60 …// First of all, try to find catch-handler that can be directly connected to the block with `throw` in VisitTry() 94 // We've got `object_id` which is thrown form try-block in TryFindResolvedCatchHandler() 98 // We don't connect catch-handlers which are related to more than one try-block. in TryFindResolvedCatchHandler() 101 // - were already visited from another try-block and were marked; in TryFindResolvedCatchHandler() 172 void TryCatchResolving::RemoveCatchPhis(BasicBlock *block, Inst *throw_inst) in RemoveCatchPhis() argument 174 ASSERT(block->IsCatchBegin()); in RemoveCatchPhis() [all …]
|
| D | deoptimize_elimination.h | 63 * GUARD - If block have IsMustDeootimize before runtime call inst(in reverse order) 64 * RUNTIME_CALL - If block have runtime call inst before IsMustDeoptimize(in reverse order) 65 * NOTHING - If block is preccessed, but it doesn't contain GUARD and RUNTIME_CALL 108 void PushNewBlockType(BasicBlock *block, BlockType type) in PushNewBlockType() argument 110 ASSERT(blocks_type_.find(block) == blocks_type_.end()); in PushNewBlockType() 111 blocks_type_.emplace(block, type); in PushNewBlockType() 114 BlockType GetBlockType(BasicBlock *block) in GetBlockType() argument 116 if (blocks_type_.find(block) != blocks_type_.end()) { in GetBlockType() 117 return blocks_type_.at(block); in GetBlockType() 124 …bool CanRemoveGuardRec(BasicBlock *block, Inst *guard, const Marker &mrk, const Marker &remove_mrk…
|
| /arkcompiler/runtime_core/compiler/tests/ |
| D | iterators_test.cpp | 28 auto block = &BB(0); in Check() local 29 PopulateBlock(block, tested_instructions); in Check() 34 for (auto inst : block->PhiInsts()) { in Check() 40 for (auto inst : block->Insts()) { in Check() 46 for (auto inst : block->AllInsts()) { in Check() 53 for (auto inst : block->PhiInstsSafe()) { in Check() 59 for (auto inst : block->InstsSafe()) { in Check() 65 for (auto inst : block->AllInstsSafe()) { in Check() 72 for (auto inst : block->PhiInstsSafeReverse()) { in Check() 79 for (auto inst : block->InstsSafeReverse()) { in Check() [all …]
|
| /arkcompiler/runtime_core/runtime/ |
| D | global_handle_storage-inl.h | 29 for (auto block : *globalNodes_) { in ~GlobalHandleStorage() 30 allocator_->Delete(block); in ~GlobalHandleStorage() 39 // alloc new block in NewGlobalHandle() 40 auto block = allocator_->New<std::array<Node, GLOBAL_BLOCK_SIZE>>(); in NewGlobalHandle() local 41 globalNodes_->push_back(block); in NewGlobalHandle() 45 // use node in block first in NewGlobalHandle() 84 …lHandleStorage<coretypes::TaggedType>::DealUpdateObject(std::array<Node, GLOBAL_BLOCK_SIZE> *block, in DealUpdateObject() argument 87 coretypes::TaggedValue obj(block->at(index).GetObject()); in DealUpdateObject() 90 block->at(index).SetObject(value.GetRawData()); in DealUpdateObject() 102 auto block = globalNodes_->at(i); in UpdateHeapObject() local [all …]
|
| /arkcompiler/runtime_core/irtoc/lang/ |
| D | function.rb | 80 validate: nil, enable_builder: false, lang: 'PANDA_ASSEMBLY', &block) argument 99 @body = block 122 # Return true if graph doesn't contain conditional basic block, i.e. with more than one successor. 142 raise "Invalid `While` block" if @cf_stack[-1].head_bb.nil? 143 block = @cf_stack[-1].head_bb 145 block = @current_block 147 inst = IRInstruction.new(opcode, inst_index(), block) 152 block.append inst unless inst.global? 184 def method_missing(method, *args, &block) argument 185 if Options.compiling && args.empty? && block.nil? [all …]
|
| /arkcompiler/runtime_core/runtime/mem/refstorage/ |
| D | ref_block.cpp | 56 for (auto *block : *this) { in VisitObjects() 57 if (block->IsEmpty()) { in VisitObjects() 61 if (block->IsBusyIndex(index)) { in VisitObjects() 62 auto object_pointer = block->refs_[index]; in VisitObjects() 74 for (auto *block : *this) { in UpdateMovedRefs() 75 if (block->IsEmpty()) { in UpdateMovedRefs() 79 if (!block->IsBusyIndex(index)) { in UpdateMovedRefs() 83 auto object_pointer = block->refs_[index]; in UpdateMovedRefs() 93 block->refs_[index] = reinterpret_cast<ObjectHeader *>(forward_address); in UpdateMovedRefs() 102 for (auto *block : *this) { in GetAllReferencesInFrame() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/builtins/ |
| D | builtins_arraybuffer.cpp | 231 // 4. Let block be CreateByteDataBlock(byteLength). in AllocateArrayBuffer() 237 // 6. Set obj’s [[ArrayBufferData]] internal slot to block. in AllocateArrayBuffer() 316 uint8_t *block = reinterpret_cast<uint8_t *>(pointer); in GetValueFromBuffer() local 317 return GetValueFromBuffer(thread, byteIndex, block, type, littleEndian); in GetValueFromBuffer() 320 …Value BuiltinsArrayBuffer::GetValueFromBuffer(JSThread *thread, uint32_t byteIndex, uint8_t *block, in GetValueFromBuffer() argument 326 uint8_t res = block[byteIndex]; // NOLINT in GetValueFromBuffer() 330 uint8_t res = block[byteIndex]; // NOLINT in GetValueFromBuffer() 335 … return GetValueFromBufferForInteger<uint16_t, NumberSize::UINT16>(block, byteIndex, littleEndian); in GetValueFromBuffer() 337 … return GetValueFromBufferForInteger<int16_t, NumberSize::INT16>(block, byteIndex, littleEndian); in GetValueFromBuffer() 339 … return GetValueFromBufferForInteger<uint32_t, NumberSize::UINT32>(block, byteIndex, littleEndian); in GetValueFromBuffer() [all …]
|
| D | builtins_arraybuffer.h | 76 …static JSTaggedValue SetValueInBuffer(uint32_t byteIndex, uint8_t *block, DataViewType type, doubl… 78 static JSTaggedValue GetValueFromBuffer(JSThread *thread, uint32_t byteIndex, uint8_t *block, 88 static void SetTypeData(uint8_t *block, T value, uint32_t index); 91 …static JSTaggedValue GetValueFromBufferForInteger(uint8_t *block, uint32_t byteIndex, bool littleE… 94 …static JSTaggedValue GetValueFromBufferForFloat(uint8_t *block, uint32_t byteIndex, bool littleEnd… 96 static JSTaggedValue GetValueFromBufferForBigInt(JSThread *thread, uint8_t *block, 100 static void SetValueInBufferForByte(double val, uint8_t *block, uint32_t byteIndex); 102 static void SetValueInBufferForUint8Clamped(double val, uint8_t *block, uint32_t byteIndex); 105 …static void SetValueInBufferForInteger(double val, uint8_t *block, uint32_t byteIndex, bool little… 108 …static void SetValueInBufferForFloat(double val, uint8_t *block, uint32_t byteIndex, bool littleEn…
|
| /arkcompiler/ets_frontend/merge_abc/src/ |
| D | assemblyFunctionProto.cpp | 20 void CatchBlock::Serialize(const panda::pandasm::Function::CatchBlock &block, protoPanda::CatchBloc… in Serialize() argument 22 protoBlock.set_wholeline(block.whole_line); in Serialize() 23 protoBlock.set_exceptionrecord(block.exception_record); in Serialize() 24 protoBlock.set_trybeginlabel(block.try_begin_label); in Serialize() 25 protoBlock.set_tryendlabel(block.try_end_label); in Serialize() 26 protoBlock.set_catchbeginlabel(block.catch_begin_label); in Serialize() 27 protoBlock.set_catchendlabel(block.catch_end_label); in Serialize() 30 …:Deserialize(const protoPanda::CatchBlock &protoBlock, panda::pandasm::Function::CatchBlock &block) in Deserialize() argument 32 block.whole_line = protoBlock.wholeline(); in Deserialize() 33 block.exception_record = protoBlock.exceptionrecord(); in Deserialize() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/optimizations/regalloc/ |
| D | split_resolver.cpp | 34 // Connect siblings within the same block. in Run() 38 for (auto block : liveness_->GetLinearizedBlocks()) { in Run() local 39 ASSERT(block != nullptr); in Run() 40 if (!block->IsEndBlock()) { in Run() 41 ProcessBlock(block); in Run() 59 // some block), so the SpillFill should be placed at the end of predecessor block. in ConnectSiblings() 69 void SplitResolver::ProcessBlock(BasicBlock *block) in ProcessBlock() argument 71 auto succ_begin = liveness_->GetBlockLiveRange(block).GetBegin(); in ProcessBlock() 85 ConnectSpiltFromPredBlock(input_bb, input_liveness, block, interval); in ProcessBlock() 99 for (auto pred : block->GetPredsBlocks()) { in ProcessBlock() [all …]
|
| /arkcompiler/runtime_core/bytecode_optimizer/ |
| D | reg_acc_alloc.cpp | 30 compiler::BasicBlock *block = src_inst->GetBasicBlock(); in IsAccWriteBetween() local 38 if (block->GetSuccsBlocks().size() > 1) { in IsAccWriteBetween() 42 ASSERT(block->GetSuccsBlocks().size() == 1); in IsAccWriteBetween() 43 block = block->GetSuccessor(0); in IsAccWriteBetween() 46 if (!dst_inst->IsPhi() && block->GetPredsBlocks().size() > 1) { in IsAccWriteBetween() 49 } while (block->IsEmpty() && !block->HasPhi()); in IsAccWriteBetween() 53 inst = *(block->AllInsts()); in IsAccWriteBetween() 216 for (auto block : GetGraph()->GetBlocksRPO()) { in RunImpl() local 217 for (auto inst : block->Insts()) { in RunImpl() 236 for (auto block : GetGraph()->GetBlocksRPO()) { in RunImpl() local [all …]
|