| /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 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() 32 ancestors_(graph->GetLocalAllocator()->Adapter()), in Cleanup() 33 buckets_(graph->GetLocalAllocator()->Adapter()), in Cleanup() 34 idoms_(graph->GetLocalAllocator()->Adapter()), in Cleanup() [all …]
|
| D | vn.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 24 static void AddSpecialTraits(Inst *inst, VnObject *obj) in AddSpecialTraits() argument 26 switch (inst->GetOpcode()) { in AddSpecialTraits() 28 if (inst->GetFlagsMask() == 0) { in AddSpecialTraits() 30 obj->Add(static_cast<uint32_t>(inst->CastToIntrinsic()->GetIntrinsicId())); in AddSpecialTraits() 34 obj->Add(static_cast<uint32_t>(inst->CastToCompareAnyType()->GetAnyType())); in AddSpecialTraits() 37 obj->Add(static_cast<uint32_t>(inst->CastToCastAnyTypeValue()->GetAnyType())); in AddSpecialTraits() 44 void VnObject::Add(Inst *inst) in Add() argument 46 Add(static_cast<uint32_t>(inst->GetOpcode())); in Add() [all …]
|
| D | cleanup.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 28 // TODO (a.popov) Make empty catch-begin and try-end blocks removeable in SkipBasicBlock() 29 …return bb == nullptr || bb->IsStartBlock() || bb->IsEndBlock() || bb->IsCatchBegin() || bb->IsTryE… in SkipBasicBlock() 38 GetGraph()->RunPass<DominatorsTree>(); in RunImpl() 39 GetGraph()->RunPass<LoopAnalyzer>(); in RunImpl() 47 for (auto bb : GetGraph()->GetVectorBlocks()) { in RunImpl() 48 if (!SkipBasicBlock(bb) && bb->IsEmpty()) { in RunImpl() 49 empty_blocks->insert(bb); in RunImpl() 62 new_empty_blocks->clear(); in RunImpl() [all …]
|
| D | lowering.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 21 void Lowering::VisitIfImm([[maybe_unused]] GraphVisitor *v, Inst *inst) in VisitIfImm() argument 23 ASSERT(inst->GetOpcode() == Opcode::IfImm); in VisitIfImm() 24 LowerIf(inst->CastToIfImm()); in VisitIfImm() 28 bool Lowering::ConstantFitsCompareImm(Inst *cst, uint32_t size, ConditionCode cc) in ConstantFitsCompareImm() 30 ASSERT(cst->GetOpcode() == Opcode::Constant); in ConstantFitsCompareImm() 31 if (DataType::IsFloatType(cst->GetType())) { in ConstantFitsCompareImm() 34 int64_t val = cst->CastToConstant()->GetRawValue(); in ConstantFitsCompareImm() 39 bool Lowering::BetterToSwapCompareInputs(Inst *cmp) in BetterToSwapCompareInputs() [all …]
|
| D | move_constants.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 25 user_dominators_cache_ {graph->GetLocalAllocator()->Adapter()}, 26 user_dominating_blocks_ {graph->GetLocalAllocator()->Adapter()}, 31 static Inst *SingleBlockNoPhiDominatingUser(Inst *inst); 35 for (auto const_inst = GetGraph()->GetFirstConstInst(); const_inst != nullptr;) { in RunImpl() 37 auto next_const = const_inst->GetNextConst(); in RunImpl() 38 if (const_inst->HasUsers()) { in RunImpl() 49 return (!bb->IsLoopValid() || bb->GetLoop()->IsRoot()) && !bb->IsTryBegin(); in IsBlockSuitable() 52 void MoveConstants::MoveFromStartBlock(Inst *inst) in MoveFromStartBlock() argument [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/ir_builder/ |
| D | inst_templates.yaml | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 15 binop: |- 17 % opc = inst.stripped_mnemonic.match regex_arithm 20 …auto inst = graph_->CreateInst<%= opc %>(<%= get_type(inst.dtype) %>, GetPc(instruction->GetAddres… 21 <%=template('operands', inst, '')-%> 22 AddInstruction(inst); 23 binop_z: |- 24 % opc = inst.stripped_mnemonic =~ /div/ ? 'Div' : 'Mod' 25 auto inst_save_state = CreateSaveState(Opcode::SaveState, GetPc(instruction->GetAddress())); [all …]
|
| /arkcompiler/runtime_core/compiler/tests/ |
| D | iterators_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 26 void Check(std::vector<Inst *> &tested_instructions) in Check() 33 std::vector<Inst *> result; in Check() 34 for (auto inst : block->PhiInsts()) { in Check() local 35 result.push_back(inst); in Check() 40 for (auto inst : block->Insts()) { in Check() local 41 result.push_back(inst); in Check() 46 for (auto inst : block->AllInsts()) { in Check() local 47 result.push_back(inst); in Check() [all …]
|
| D | vn_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 47 BASIC_BLOCK(2, -1) in TEST_F() 49 INST(6, Opcode::Add).u64().Inputs(0, 1); in TEST_F() 50 INST(7, Opcode::Sub).u32().Inputs(1, 0); in TEST_F() 51 INST(8, Opcode::Mul).f32().Inputs(4, 5); in TEST_F() 52 INST(9, Opcode::Div).f64().Inputs(3, 2); in TEST_F() 53 INST(10, Opcode::Sub).u32().Inputs(1, 0); in TEST_F() 54 INST(11, Opcode::Div).f64().Inputs(3, 2); in TEST_F() 55 INST(12, Opcode::Mul).f32().Inputs(4, 5); in TEST_F() [all …]
|
| D | move_constants_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 33 INST(2, Opcode::IfImm).CC(CC_GE).Imm(5).Inputs(0); in TEST_F() 36 BASIC_BLOCK(3, -1) in TEST_F() 38 INST(3, Opcode::ReturnI).u64().Imm(0); in TEST_F() 43 INST(4, Opcode::IfImm).CC(CC_LE).Imm(10).Inputs(0); in TEST_F() 46 BASIC_BLOCK(5, -1) in TEST_F() 48 INST(6, Opcode::Return).ref().Inputs(1); in TEST_F() 51 BASIC_BLOCK(6, -1) in TEST_F() 53 INST(8, Opcode::Return).ref().Inputs(1); in TEST_F() [all …]
|
| D | cleanup_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 29 BASIC_BLOCK(3, -1) in TEST_F() 31 INST(0, Opcode::ReturnVoid); in TEST_F() 35 ASSERT_TRUE(GetGraph()->RunPass<Cleanup>()); in TEST_F() 40 BASIC_BLOCK(3, -1) in TEST_F() 42 INST(0, Opcode::ReturnVoid); in TEST_F() 56 INST(2, Opcode::If).SrcType(DataType::Type::INT64).CC(CC_LE).Inputs(0, 1); in TEST_F() 60 INST(3, Opcode::If).SrcType(DataType::Type::INT64).CC(CC_EQ).Inputs(0, 1); in TEST_F() 64 INST(4, Opcode::Add).s64().Inputs(0, 1); in TEST_F() [all …]
|
| D | graph_cloner_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 42 INST(44, Opcode::LoadAndInitClass).ref().Inputs().TypeId(68); in TEST_F() 43 INST(3, Opcode::NewArray).ref().Inputs(44, 2); in TEST_F() 44 INST(14, Opcode::Compare).CC(ConditionCode::CC_LT).b().Inputs(0, 13); // i < X in TEST_F() 45 INST(15, Opcode::IfImm).SrcType(DataType::BOOL).CC(CC_NE).Imm(0).Inputs(14); in TEST_F() 49 INST(4, Opcode::Phi).s32().Inputs(0, 10); in TEST_F() 50 INST(7, Opcode::SaveState).Inputs(0, 1, 2, 3).SrcVregs({0, 1, 2, 3}); in TEST_F() 51 INST(8, Opcode::BoundsCheck).s32().Inputs(2, 4, 7); in TEST_F() 52 INST(9, Opcode::StoreArray).s32().Inputs(3, 8, 0); // a[i] = 0 in TEST_F() [all …]
|
| D | reg_alloc_common_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 52 BASIC_BLOCK(2, -1) in TestParametersLocations() 54 INST(30, Opcode::SaveState).Inputs(0).SrcVregs({0}); in TestParametersLocations() 55 INST(11, Opcode::NullCheck).ref().Inputs(0, 30); in TestParametersLocations() 56 INST(12, Opcode::StoreObject).u64().Inputs(11, 1); in TestParametersLocations() 57 INST(13, Opcode::StoreObject).u64().Inputs(11, 2); in TestParametersLocations() 58 INST(14, Opcode::StoreObject).u64().Inputs(11, 3); in TestParametersLocations() 59 INST(15, Opcode::StoreObject).u64().Inputs(11, 4); in TestParametersLocations() 60 INST(16, Opcode::StoreObject).u64().Inputs(11, 5); in TestParametersLocations() 61 INST(17, Opcode::StoreObject).u64().Inputs(11, 6); in TestParametersLocations() [all …]
|
| /arkcompiler/runtime_core/libpandafile/tests/ |
| D | bytecode_instruction_tests.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 23 #include "bytecode_instruction-inl.h" 32 BytecodeInstruction inst(bytecode); in TEST() local 33 EXPECT_EQ(static_cast<uint8_t>(inst.GetOpcode()), 0x00); in TEST() 34 EXPECT_EQ((inst.GetVReg<BytecodeInstruction::Format::V4_IMM4, 0>()), 1); in TEST() 35 EXPECT_EQ((inst.GetImm<BytecodeInstruction::Format::V4_IMM4, 0>()), -6); in TEST() 40 BytecodeInstruction inst(bytecode); in TEST() local 41 EXPECT_EQ(static_cast<uint8_t>(inst.GetOpcode()), 0x00); in TEST() 42 EXPECT_EQ((inst.GetVReg<BytecodeInstruction::Format::V4_IMM4, 0>()), 0xf); in TEST() [all …]
|
| /arkcompiler/runtime_core/bytecode_optimizer/ |
| D | reg_acc_alloc.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 19 #include "compiler/optimizer/ir/inst.h" 26 bool IsAccWriteBetween(compiler::Inst *src_inst, compiler::Inst *dst_inst) in IsAccWriteBetween() 30 compiler::BasicBlock *block = src_inst->GetBasicBlock(); in IsAccWriteBetween() 31 compiler::Inst *inst = src_inst->GetNext(); in IsAccWriteBetween() local 33 while (inst != dst_inst) { in IsAccWriteBetween() 34 if (UNLIKELY(inst == nullptr)) { in IsAccWriteBetween() 38 if (block->GetSuccsBlocks().size() > 1) { in IsAccWriteBetween() 42 ASSERT(block->GetSuccsBlocks().size() == 1); in IsAccWriteBetween() [all …]
|
| D | reg_encoder.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 22 static bool IsIntrinsicRange(Inst *inst) in IsIntrinsicRange() argument 24 if (inst->GetOpcode() != compiler::Opcode::Intrinsic) { in IsIntrinsicRange() 28 switch (inst->CastToIntrinsic()->GetIntrinsicId()) { in IsIntrinsicRange() 50 static bool CanHoldRange(Inst *inst) in CanHoldRange() argument 52 switch (inst->GetOpcode()) { in CanHoldRange() 54 return IsIntrinsicRange(inst); in CanHoldRange() 64 for (auto bb : graph->GetBlocksRPO()) { in CalculateNumNeededRangeTemps() 65 for (const auto &inst : bb->AllInsts()) { in CalculateNumNeededRangeTemps() local [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/ir/ |
| D | ir_constructor.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 33 * INST(0, Opcode::IntConstant).Constant(12); 34 * INST(1, Opcode::IntConstant).Constant(12); 35 * INST(2, Opcode::Add).Inputs(0, 1); 36 * INST(6, Opcode::Compare).Inputs(2).CC(ConditionCode::CC_AE); 37 * INST(7, Opcode::If).Inputs(6); 40 * INST(3, Opcode::Not).Inputs(0); 42 * BASIC_BLOCK(2, -1) { 43 * INST(4, Opcode::Phi).Inputs(2, 3); [all …]
|
| D | basicblock.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 18 #include "inst.h" 23 class Inst; 26 preds_(graph_->GetAllocator()->Adapter()), in BasicBlock() 27 succs_(graph_->GetAllocator()->Adapter()), in BasicBlock() 28 dom_blocks_(graph_->GetAllocator()->Adapter()), in BasicBlock() 35 return (graph_->GetStartBlock() == this); in IsStartBlock() 39 return (graph_->GetEndBlock() == this); in IsEndBlock() 49 return (GetLoop()->GetHeader() == this); in IsLoopHeader() [all …]
|
| D | graph_checker.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 34 GetGraph()->GetPassManager()->SetCheckMode(true); in GraphChecker() 44 for (auto block : graph->GetVectorBlocks()) { in UserInputCheck() 48 for (auto inst : block->AllInsts()) { in UserInputCheck() local 49 auto u = inst->GetFirstUser(); in UserInputCheck() 50 ASSERT(u == nullptr || u->GetPrev() == nullptr); in UserInputCheck() 52 ASSERT(u->GetNext() == nullptr || u->GetNext()->GetPrev() == u); in UserInputCheck() 53 u = u->GetNext(); in UserInputCheck() 55 for (auto &user : inst->GetUsers()) { in UserInputCheck() [all …]
|
| D | graph_checker.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 44 GetGraph()->GetPassManager()->SetCheckMode(false); in ~GraphChecker() 62 void CheckPhiInputs(Inst *phi_inst); 69 bool CheckInstHasInput(Inst *inst, Inst *input); 70 bool CheckInstHasUser(Inst *inst, Inst *user); 72 void CheckSpillFillHolder(Inst *inst); 73 bool CheckInstRegUsageSaved(const Inst *inst, Register reg) const; 86 …void CheckObjectRec(const Inst *object, const Inst *user, const BasicBlock *block, Inst *start_fro… 88 void FindObjectInSaveState(const Inst *object, Inst *ss) const; [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/optimizations/regalloc/ |
| D | reg_alloc_resolver.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 18 #include "compiler/optimizer/ir/inst.h" 33 for (auto block : GetGraph()->GetBlocksRPO()) { in Resolve() 34 for (auto inst : block->AllInstsSafe()) { in Resolve() local 35 if (inst->IsSaveState()) { in Resolve() 38 ResolveInputs(inst); in Resolve() 39 ResolveOutput(inst); in Resolve() 40 if (GetGraph()->IsInstThrowable(inst)) { in Resolve() 41 AddCatchPhiMoves(inst); in Resolve() [all …]
|
| /arkcompiler/runtime_core/libark_defect_scan_aux/ |
| D | graph.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 28 bool Inst::operator==(const Inst &inst) const in operator ==() 30 return inst_ == inst.inst_; in operator ==() 33 bool Inst::operator!=(const Inst &inst) const in operator !=() 35 return inst_ != inst.inst_; in operator !=() 38 InstType Inst::GetType() const in GetType() 43 bool Inst::IsInstStLexVar() const in IsInstStLexVar() 49 bool Inst::IsInstLdLexVar() const in IsInstLdLexVar() 55 bool Inst::IsInstStGlobal() const in IsInstStGlobal() 62 bool Inst::IsInstLdGlobal() const in IsInstLdGlobal() [all …]
|
| /arkcompiler/runtime_core/bytecode_optimizer/tests/ |
| D | const_array_resolver_test.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 29 BASIC_BLOCK(2, -1) in TEST_F() 31 INST(20, Opcode::SaveState).NoVregs(); in TEST_F() 32 INST(4, Opcode::LoadAndInitClass).ref().Inputs(20).TypeId(68); in TEST_F() 33 INST(3, Opcode::NewArray).ref().Inputs(4, 1, 20); in TEST_F() 34 INST(11, Opcode::StoreArray).u64().Inputs(3, 2, 2); in TEST_F() 35 INST(13, Opcode::StoreArray).u64().Inputs(3, 2, 2); in TEST_F() 36 INST(10, Opcode::Return).ref().Inputs(3); in TEST_F() 45 EXPECT_TRUE(graph->RunPass<ConstArrayResolver>(&interface)); in TEST_F() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/templates/ |
| D | inst_checker_gen.h.erb | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 27 return graph_->GetBlocksRPO(); 35 static DataType::Type GetInputType(Inst* inst, size_t input) 37 return inst->GetInput(input).GetInst()->GetType(); 45 % IR::instructions.each do |inst| 46 … static void Visit<%= inst.opcode %>([[maybe_unused]] GraphVisitor *v, [[maybe_unused]] Inst *inst) 48 % if !inst.has_dst? 49 ASSERT(!inst->HasUsers()); 50 % elsif !inst.dst.pseudo? [all …]
|
| D | inst_builder_gen.cpp.erb | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 41 …return "FindOrCreateConstant(instruction->GetImm<#{get_format}, #{get_input_idx(index, :imm?)}>())… 42 …return "GetDefinition(instruction->GetId<#{get_format}, #{get_input_idx(index, :id?)}>().GetOffset… 44 return "GetDefinition(instruction->GetVReg<#{get_format}, #{get_input_idx(index, :reg?)}>())" 89 def get_template_by_inst(inst) 90 if (inst.namespace == "ecmascript") 93 return get_template(inst.stripped_mnemonic) 137 def template(name, inst, indent, context = {}) 140 …indent + ERB.new(@inst_yaml['templates'][name], nil, '%-').result(binding).gsub("\n", "\n#{indent}… [all …]
|
| D | generate_ecma.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 // NOLINTNEXTLINE(readability-function-size) 19 void panda::bytecodeopt::BytecodeGen::VisitEcma(panda::compiler::GraphVisitor *visitor, Inst *inst_… 21 ASSERT(inst_base->IsIntrinsic()); 22 auto inst = inst_base->CastToIntrinsic(); 25 switch (inst->GetIntrinsicId()) { 33 % inst = group.first 34 % next if inst.properties.include?("jump") [all …]
|