//===-- ARMOptimizeBarriersPass - two DMBs without a memory access in between, //removed one -===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===------------------------------------------------------------------------------------------===// #include "ARM.h" #include "ARMInstrInfo.h" #include "ARMMachineFunctionInfo.h" #include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/MachineFunctionPass.h" usingnamespacellvm; #define DEBUG_TYPE … STATISTIC(NumDMBsRemoved, "Number of DMBs removed"); namespace { class ARMOptimizeBarriersPass : public MachineFunctionPass { … }; char ARMOptimizeBarriersPass::ID = …; } // Returns whether the instruction can safely move past a DMB instruction // The current implementation allows this iif MI does not have any possible // memory access static bool CanMovePastDMB(const MachineInstr *MI) { … } bool ARMOptimizeBarriersPass::runOnMachineFunction(MachineFunction &MF) { … } /// createARMOptimizeBarriersPass - Returns an instance of the remove double /// barriers /// pass. FunctionPass *llvm::createARMOptimizeBarriersPass() { … }