| /arkcompiler/runtime_core/compiler/tests/ |
| D | unit_test.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 39 if (arg_types == nullptr || index >= arg_types->size()) { in GetMethodTotalArgumentType() 42 return arg_types->at(index); in GetMethodTotalArgumentType() 50 return arg_types->size(); in GetMethodTotalArgumentsCount() 73 // We have issue with QEMU - so reduce memory heap in CommonTest() 106 Graph *CreateEmptyGraph(bool is_osr = false) const 108 return GetAllocator()->New<Graph>(GetAllocator(), GetLocalAllocator(), arch_, is_osr); 111 Graph *CreateEmptyGraph(Arch arch) const in CreateEmptyGraph() 113 return GetAllocator()->New<Graph>(GetAllocator(), GetLocalAllocator(), arch, false); in CreateEmptyGraph() [all …]
|
| D | compiler_graph_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 34 #include "graph.h" 35 #include "graph.cpp" 68 …graph_test_.TestBuildGraphFromFile(pfile, [&test_method_name, &status](Graph* graph, std::string &… in __anon1425b6d40102() argument 73 EXPECT_NE(graph, nullptr); in __anon1425b6d40102() 74 auto start_block = graph->GetStartBlock(); in __anon1425b6d40102() 77 EXPECT_TRUE(start_block->IsMarked(mrk)); in __anon1425b6d40102() 93 …graph_test_.TestBuildGraphFromFile(pfile, [&test_method_name, &status](Graph* graph, std::string &… in __anon1425b6d40202() argument 98 EXPECT_NE(graph, nullptr); in __anon1425b6d40202() 101 for (const auto &block : graph->GetVectorBlocks()) { in __anon1425b6d40202() [all …]
|
| D | compiler_basicblock_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 25 #include "graph.h" 53 graph_test_.TestBuildGraphFromFile(pfile, [&](Graph* graph, std::string &method_name) { in __anond946d00f0102() argument 55 auto start_block = graph->GetStartBlock(); in __anond946d00f0102() 56 auto end_block = graph->GetEndBlock(); in __anond946d00f0102() 59 for (auto bb : graph->GetBlocksRPO()) { in __anond946d00f0102() 60 if (!bb->IsCatchBegin()) { in __anond946d00f0102() 64 EXPECT_TRUE(BlocksPathDfsSearch(mrk, start_block, end_block, bb->GetSuccessor(0))); in __anond946d00f0102() 65 EXPECT_FALSE(BlocksPathDfsSearch(mrk, start_block, bb->GetSuccessor(0), end_block)); in __anond946d00f0102() 66 EXPECT_FALSE(BlocksPathDfsSearch(mrk, end_block, start_block, bb->GetSuccessor(0))); in __anond946d00f0102() [all …]
|
| D | ir_builder_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 67 auto graph = CreateGraphWithDefaultRuntime(); in CheckSimple() local 68 GRAPH(graph) in CheckSimple() 73 BASIC_BLOCK(2, -1) in CheckSimple() 79 ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph)); in CheckSimple() 107 auto graph = CreateGraphWithDefaultRuntime(); in CheckSimpleWithImm() local 109 GRAPH(graph) in CheckSimpleWithImm() 114 BASIC_BLOCK(2, -1) in CheckSimpleWithImm() 120 ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph)); in CheckSimpleWithImm() [all …]
|
| D | compiler_inst_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 27 #include "graph.h" 78 …graph_test_.TestBuildGraphFromFile(pfile, [&test_method_name, &status](Graph* graph, std::string &… in __anon1be7da800102() argument 83 EXPECT_NE(graph, nullptr); in __anon1be7da800102() 85 for (auto bb : graph->GetBlocksRPO()) { in __anon1be7da800102() 86 for (auto inst : bb->AllInsts()) { in __anon1be7da800102() 87 if (!inst->IsSaveState()) { in __anon1be7da800102() 91 auto save_state_inst = inst->CastToSaveState(); in __anon1be7da800102() 92 save_state_inst->AllocateImmediates(graph->GetAllocator(), size); in __anon1be7da800102() 93 EXPECT_EQ(save_state_inst->GetImmediatesCount(), size); in __anon1be7da800102() [all …]
|
| D | dump_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 27 #include "graph.h" 62 …graph_test_.TestBuildGraphFromFile(pfile, [&test_method_name, &status](Graph* graph, std::string &… in __anon51f1233e0102() argument 67 EXPECT_NE(graph, nullptr); in __anon51f1233e0102() 68 for (auto bb : graph->GetBlocksRPO()) { in __anon51f1233e0102() 69 for (auto inst : bb->AllInsts()) { in __anon51f1233e0102() 70 if (inst->GetOpcode() != Opcode::SaveState) { in __anon51f1233e0102() 71 auto value1 = InstId(inst, graph->GetAllocator()); in __anon51f1233e0102() 76 auto value = InstId(inst, graph->GetAllocator()); in __anon51f1233e0102() 95 …graph_test_.TestBuildGraphFromFile(pfile, [&test_method_name, &status](Graph* graph, std::string &… in __anon51f1233e0202() argument [all …]
|
| D | loop_analyzer_new_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 19 #include "graph.h" 50 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anonf25df3b00102() argument 55 EXPECT_NE(graph, nullptr); in __anonf25df3b00102() 56 EXPECT_TRUE(graph->RunPass<LoopAnalyzer>()); in __anonf25df3b00102() 73 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anonf25df3b00202() argument 78 EXPECT_NE(graph, nullptr); in __anonf25df3b00202() 79 for (auto bb : graph->GetBlocksRPO()) { in __anonf25df3b00202() 81 if (!bb->IsTryBegin()) { in __anonf25df3b00202() 84 Loop loop(graph->GetAllocator(), bb->GetSuccessor(0), 1); in __anonf25df3b00202() [all …]
|
| D | liveness_analyzer_new_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 19 #include "graph.h" 50 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anonf1f112df0102() argument 55 EXPECT_NE(graph, nullptr); in __anonf1f112df0102() 56 LivenessAnalyzer liveness_analyzer(graph); in __anonf1f112df0102() 59 std::string str = "\nRegisters intervals\n-\n\n" in __anonf1f112df0102() 60 "Vector registers intervals\n-\n\n" in __anonf1f112df0102() 61 "Stack slots intervals\n-\n"; in __anonf1f112df0102() 80 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anonf1f112df0202() argument 85 EXPECT_NE(graph, nullptr); in __anonf1f112df0202() [all …]
|
| D | compiler_regalloc_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 81 …graph_test_.TestBuildGraphFromFile(pfile, [&test_method_name, &status](Graph* graph, std::string &… in __anonfa4f11eb0302() argument 86 EXPECT_NE(graph, nullptr); in __anonfa4f11eb0302() 87 InterferenceGraph inter_graph(graph->GetAllocator()); in __anonfa4f11eb0302() 91 cnode->SetBias(1); in __anonfa4f11eb0302() 92 EXPECT_EQ(cnode->GetBias(), 1); in __anonfa4f11eb0302() 93 EXPECT_FALSE(cnode->IsPhysical()); in __anonfa4f11eb0302() 97 cnode->SetFixedColor(color, is_physical); in __anonfa4f11eb0302() 98 EXPECT_TRUE(cnode->IsPhysical()); in __anonfa4f11eb0302() 100 cnode->SetFixedColor(color, is_physical); in __anonfa4f11eb0302() [all …]
|
| D | linear_order_new_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 19 #include "graph.h" 50 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anond752aec70102() argument 55 EXPECT_NE(graph, nullptr); in __anond752aec70102() 56 EXPECT_TRUE(graph->RunPass<LinearOrder>()); in __anond752aec70102() 73 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anond752aec70202() argument 78 EXPECT_NE(graph, nullptr); in __anond752aec70202() 80 for (auto bb : graph->GetBlocksRPO()) { in __anond752aec70202() 81 if (bb->IsTryBegin()) { in __anond752aec70202() 82 graph->SetStartBlock(bb->GetSuccessor(1)); in __anond752aec70202() [all …]
|
| D | compiler_optimizations_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 31 #include "optimizer/ir/graph.h" 79 graph_test_.TestBuildGraphFromFile(pfile, [&test_method_name, &status, &status1](Graph* graph, 84 EXPECT_NE(graph, nullptr); in __anon87bf345c0102() 87 for (const auto &block : graph->GetVectorBlocks()) { in __anon87bf345c0102() 91 for (auto inst : block->AllInsts()) { in __anon87bf345c0102() 92 if (inst->GetOpcode() == Opcode::SaveState) { in __anon87bf345c0102() 93 inst->SetType(DataType::UINT64); in __anon87bf345c0102() 94 EXPECT_EQ(inst->GetType(), DataType::UINT64); in __anon87bf345c0102() 99 if (inst->GetOpcode() == Opcode::Intrinsic) { in __anon87bf345c0102() [all …]
|
| D | dominators_tree_new_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 19 #include "graph.h" 49 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anone12190200102() argument 54 EXPECT_NE(graph, nullptr); in __anone12190200102() 55 for (auto bb : graph->GetBlocksRPO()) { in __anone12190200102() 57 if (!bb->IsCatchBegin()) { in __anone12190200102() 60 DominatorsTree dominators_tree(graph); in __anone12190200102() 61 bb->GetPredecessor(1)->SetDominator(bb->GetPredecessor(0)); in __anone12190200102() 62 EXPECT_NE(bb->GetPredecessor(1)->GetDominator(), nullptr); in __anone12190200102() 63 bb->GetPredecessor(0)->AddDominatedBlock(bb->GetPredecessor(1)); in __anone12190200102() [all …]
|
| D | reg_alloc_common_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 25 void RunRegAllocatorsAndCheck(Graph *graph, Checker checker) const in RunRegAllocatorsAndCheck() argument 37 auto graph = CreateEmptyGraph(); in TestParametersLocations() local 39 GRAPH(graph) in TestParametersLocations() 52 BASIC_BLOCK(2, -1) in TestParametersLocations() 69 GRAPH(graph) in TestParametersLocations() 82 BASIC_BLOCK(2, -1) in TestParametersLocations() 100 RunRegAllocatorsAndCheck(graph, [type = reg_type](Graph *check_graph) { in TestParametersLocations() 101 auto arch = check_graph->GetArch(); in TestParametersLocations() 105 if (Arch::AARCH64 == check_graph->GetArch()) { in TestParametersLocations() [all …]
|
| D | cleanup_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 26 GRAPH(GetGraph()) in TEST_F() 29 BASIC_BLOCK(3, -1) in TEST_F() 35 ASSERT_TRUE(GetGraph()->RunPass<Cleanup>()); in TEST_F() 37 auto graph = CreateEmptyGraph(); in TEST_F() local 38 GRAPH(graph) in TEST_F() 40 BASIC_BLOCK(3, -1) in TEST_F() 45 ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph)); in TEST_F() 50 GRAPH(GetGraph()) in TEST_F() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/ir_builder/ |
| D | ir_builder.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 19 #include "optimizer/ir/graph.h" 46 …ries boundaries {}; // NOLINT(misc-non-private-member-variables-in-class… 47 …lock *begin_bb {nullptr}; // NOLINT(misc-non-private-member-variables-in-class… 48 …lock *end_bb {nullptr}; // NOLINT(misc-non-private-member-variables-in-class… 49 …ector<CatchCodeBlock> *catches {nullptr}; // NOLINT(misc-non-private-member-variables-in-class… 50 …ector<BasicBlock *> *basic_blocks {nullptr}; // NOLINT(misc-non-private-member-variables-in-class… 51 …_t id {INVALID_ID}; // NOLINT(misc-non-private-member-variables-in-class… 52 …ontains_throwable_inst {false}; // NOLINT(misc-non-private-member-variables-in-class… [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/ir/ |
| D | graph.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 16 #include "graph.h" 27 if (block->SetMarker(mrk)) { in MarkBlocksRec() 30 for (auto succ : block->GetSuccsBlocks()) { in MarkBlocksRec() 35 Graph::~Graph() in ~Graph() 39 void Graph::RemoveUnreachableBlocks() in RemoveUnreachableBlocks() 48 if (!bb->IsMarked(mrk)) { in RemoveUnreachableBlocks() 51 if (bb->IsTryBegin()) { in RemoveUnreachableBlocks() 54 if (!bb->IsEmpty()) { in RemoveUnreachableBlocks() [all …]
|
| D | graph.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 34 class Graph; variable 44 * Specifies graph compilation mode. 50 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 66 // The graph is used in BytecodeOptimizer mode 70 // Graph will be compiled with native calling convention 76 // Graph will be compiled for calling inside interpreter 78 // Graph will be compiled for interpreter main loop 112 class Graph final : public MarkerMgr { [all …]
|
| /arkcompiler/runtime_core/bytecode_optimizer/tests/ |
| D | codegen_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 18 #include "assembler/assembly-parser.h" 97 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anona44e78530102() argument 102 EXPECT_NE(graph, nullptr); in __anona44e78530102() 103 for (auto bb : graph->GetBlocksRPO()) { in __anona44e78530102() 105 if (bb->IsTryBegin()) { in __anona44e78530102() 110 BytecodeGen bc_gen(graph, function, interface, prog); in __anona44e78530102() 111 bc_gen.EmitJump(bb->GetSuccessor(1)); in __anona44e78530102() 114 bc_gen.EmitJump(bb->GetSuccessor(0)); in __anona44e78530102() 134 …graph_test_.TestBuildGraphFromFile(pfile, [test_method_name, &status](Graph* graph, std::string &m… in __anona44e78530202() argument [all …]
|
| D | const_array_resolver_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 23 auto graph = CreateEmptyGraph(); in TEST_F() local 24 GRAPH(graph) in TEST_F() 29 BASIC_BLOCK(2, -1) in TEST_F() 45 EXPECT_TRUE(graph->RunPass<ConstArrayResolver>(&interface)); in TEST_F() 47 GRAPH(expected) in TEST_F() 52 BASIC_BLOCK(2, -1) in TEST_F() 61 EXPECT_TRUE(GraphComparator().Compare(graph, expected)); in TEST_F() 66 auto graph = CreateEmptyGraph(); in TEST_F() local [all …]
|
| /arkcompiler/runtime_core/bytecode_optimizer/ |
| D | optimize_bytecode.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 18 #include "assembler/assembly-emitter.h" 35 #include "libpandafile/class_data_accessor-inl.h" 44 // NOLINTNEXTLINE(fuchsia-statically-constructed-objects) 48 constexpr void RunOpts(compiler::Graph *graph) in RunOpts() argument 50 graph->RunPass<compiler::Cleanup>(); in RunOpts() 51 graph->RunPass<T>(); in RunOpts() 55 constexpr void RunOpts(compiler::Graph *graph) in RunOpts() argument 57 RunOpts<First>(graph); in RunOpts() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/optimizations/ |
| D | cleanup.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 19 #include "optimizer/ir/graph.h" 25 explicit Cleanup(Graph *graph) in Cleanup() argument 26 : Optimization(graph), in Cleanup() 27 empty1_(graph->GetLocalAllocator()->Adapter()), in Cleanup() 28 empty2_(graph->GetLocalAllocator()->Adapter()), in Cleanup() 29 saved_preds_(graph->GetLocalAllocator()->Adapter()), in Cleanup() 30 dead_(graph->GetLocalAllocator()->Adapter()), in Cleanup() 31 temp_(graph->GetLocalAllocator()->Adapter()), in Cleanup() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/optimizations/regalloc/ |
| D | split_resolver.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 20 #include "compiler/optimizer/ir/graph.h" 25 …explicit SplitResolver(Graph *graph) : SplitResolver(graph, &graph->GetAnalysis<LivenessAnalyzer>(… in SplitResolver() argument 26 …explicit SplitResolver(Graph *graph, LivenessAnalyzer *liveness) : graph_(graph), liveness_(livene… in SplitResolver() argument 47 if (!inst->IsSpillFill()) { in Is() 50 auto sf = inst->CastToSpillFill(); in Is() 51 ASSERT(sf->GetSpillFillType() != SpillFillType::UNKNOWN); in Is() 52 return sf->GetSpillFillType() == expected_type; in Is() 56 Graph *graph_;
|
| D | reg_alloc_resolver.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 21 #include "compiler/optimizer/ir/graph.h" 27 …explicit RegAllocResolver(Graph *graph) : graph_(graph), liveness_(&graph->GetAnalysis<LivenessAna… in RegAllocResolver() argument 53 return graph_->IsBytecodeOptimizer() && inst->GetDstReg() == ACC_REG_ID; in CanStoreToAccumulator() 57 return graph_->IsBytecodeOptimizer() && inst->GetSrcReg(input_number) == ACC_REG_ID; in CanReadFromAccumulator() 66 …ic inline void AddLocationToRoots(Location location, SaveStateInst *save_state, const Graph *graph) in AddLocationToRoots() argument 69 save_state->GetRootsRegsMask().set(location.GetValue()); in AddLocationToRoots() 71 save_state->GetRootsStackMask()->SetBit(location.GetValue()); in AddLocationToRoots() 74 auto slot_offset = graph->GetStackSlotsCount(); in AddLocationToRoots() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/templates/intrinsics/ |
| D | generate_operations_intrinsic_graph.inl.erb | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 16 // Autogenerated file -- DO NOT EDIT! 18 Graph* GenerateIntrinsicOperation(Inst* inst) { 19 auto graph = CreateGraphWithOneBasicBlock(); 20 auto intrinsic_inst = inst->CastToIntrinsic(); 21 switch (intrinsic_inst->GetIntrinsicId()) { 25 … intrinsic_inst->AllocateInputTypes(&allocator_, <%= intrinsic.arguments.length() %>); 27 … intrinsic_inst->AppendInput(CreateParamInst(graph, DataType::<%= arg %>, <%= i %>)); 28 intrinsic_inst->AddInputType(DataType::<%= arg %>); [all …]
|
| /arkcompiler/runtime_core/libark_defect_scan_aux/include/ |
| D | graph.h | 7 * http://www.apache.org/licenses/LICENSE-2.0 22 #include "compiler/optimizer/ir/graph.h" 27 class Graph; variable 48 Graph GetGraph() const; 68 Graph GetGraph() const; 77 // a wrapper class for compiler::Graph 78 class Graph { 81 explicit Graph(const compiler::Graph *graph) : graph_(graph) {} in Graph() function 82 ~Graph() = default; 90 const compiler::Graph *graph_ {nullptr};
|