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 16 #ifndef MAPLEBE_INCLUDE_AARCH64_DCE_H 17 #define MAPLEBE_INCLUDE_AARCH64_DCE_H 18 19 #include "cg_dce.h" 20 namespace maplebe { 21 class AArch64Dce : public CGDce { 22 public: AArch64Dce(MemPool & mp,CGFunc & f,CGSSAInfo & sInfo)23 AArch64Dce(MemPool &mp, CGFunc &f, CGSSAInfo &sInfo) : CGDce(mp, f, sInfo) {} 24 ~AArch64Dce() override = default; 25 26 private: 27 bool RemoveUnuseDef(VRegVersion &defVersion) override; 28 }; 29 30 class A64DeleteRegUseVisitor : public DeleteRegUseVisitor { 31 public: A64DeleteRegUseVisitor(CGSSAInfo & cgSSAInfo,uint32 dInsnID)32 A64DeleteRegUseVisitor(CGSSAInfo &cgSSAInfo, uint32 dInsnID) : DeleteRegUseVisitor(cgSSAInfo, dInsnID) {} 33 ~A64DeleteRegUseVisitor() override = default; 34 35 private: 36 void Visit(RegOperand *v) final; 37 void Visit(ListOperand *v) final; 38 void Visit(MemOperand *v) final; 39 void Visit(PhiOperand *v) final; 40 }; 41 } // namespace maplebe 42 #endif /* MAPLEBE_INCLUDE_AARCH64_DCE_H */ 43