• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef MAPLEBE_INCLUDE_CG_AARCH64_AARCH64_DATA_DEP_BASE_H
16 #define MAPLEBE_INCLUDE_CG_AARCH64_AARCH64_DATA_DEP_BASE_H
17 
18 #include "aarch64_operand.h"
19 #include "cgfunc.h"
20 #include "data_dep_base.h"
21 
22 namespace maplebe {
23 class AArch64DataDepBase : public DataDepBase {
24 public:
AArch64DataDepBase(MemPool & mp,CGFunc & func,MAD & mad,bool isIntraAna)25     AArch64DataDepBase(MemPool &mp, CGFunc &func, MAD &mad, bool isIntraAna) : DataDepBase(mp, func, mad, isIntraAna) {}
26     ~AArch64DataDepBase() override = default;
27 
28     void InitCDGNodeDataInfo(MemPool &mp, MapleAllocator &alloc, CDGNode &cdgNode) override;
29     bool IsFrameReg(const RegOperand &opnd) const override;
30     Insn *GetMemBaseDefInsn(const Insn &memInsn) const;
31 
32     void BuildDepsForMemDefCommon(Insn &insn, CDGNode &cdgNode);
33     void BuildDepsForMemUseCommon(Insn &insn, CDGNode &cdgNode);
34     void BuildDepsAccessStImmMem(Insn &insn) override;
35     void BuildCallerSavedDeps(Insn &insn) override;
36     void BuildDepsDirtyStack(Insn &insn) override;
37     void BuildDepsUseStack(Insn &insn) override;
38     void BuildDepsDirtyHeap(Insn &insn) override;
39     void BuildDepsMemBar(Insn &insn) override;
40     void BuildDepsUseMem(Insn &insn, MemOperand &memOpnd) override;
41     void BuildDepsDefMem(Insn &insn, MemOperand &memOpnd) override;
42     void BuildMemOpndDependency(Insn &insn, Operand &opnd, const OpndDesc &regProp);
43 
44     void BuildOpndDependency(Insn &insn) override;
45     void BuildSpecialInsnDependency(Insn &insn, const MapleVector<DepNode *> &nodes) override;
46     void BuildSpecialCallDeps(Insn &insn) override;
47     void BuildAsmInsnDependency(Insn &insn) override;
48 
49     void BuildInterBlockMemDefUseDependency(DepNode &depNode, bool isMemDef) override;
50     void BuildPredPathMemDefDependencyDFS(BB &curBB, std::vector<bool> &visited, DepNode &depNode) override;
51     void BuildPredPathMemUseDependencyDFS(BB &curBB, std::vector<bool> &visited, DepNode &depNode) override;
52 
53     void DumpNodeStyleInDot(std::ofstream &file, DepNode &depNode) override;
54 };
55 }  // namespace maplebe
56 
57 #endif  // MAPLEBE_INCLUDE_CG_AARCH64_AARCH64_DATA_DEP_BASE_H
58