Path: blob/main/contrib/llvm-project/llvm/lib/Target/ARM/ARMLatencyMutations.h
213799 views
//===- ARMLatencyMutations.h - ARM Latency Mutations ----------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8/// \file This file contains the ARM definition DAG scheduling mutations which9/// change inter-instruction latencies10//11//===----------------------------------------------------------------------===//1213#ifndef LLVM_LIB_TARGET_ARM_LATENCYMUTATIONS_H14#define LLVM_LIB_TARGET_ARM_LATENCYMUTATIONS_H1516#include "llvm/CodeGen/MachineScheduler.h"17#include "llvm/CodeGen/ScheduleDAGMutation.h"1819namespace llvm {2021class AAResults;22class ARMBaseInstrInfo;2324/// Post-process the DAG to create cluster edges between instrs that may25/// be fused by the processor into a single operation.26class ARMOverrideBypasses : public ScheduleDAGMutation {27public:28ARMOverrideBypasses(const ARMBaseInstrInfo *t, AAResults *a)29: ScheduleDAGMutation(), TII(t), AA(a) {}3031void apply(ScheduleDAGInstrs *DAGInstrs) override;3233private:34virtual void modifyBypasses(SUnit &) = 0;3536protected:37const ARMBaseInstrInfo *TII;38AAResults *AA;39ScheduleDAGInstrs *DAG = nullptr;4041static void setBidirLatencies(SUnit &SrcSU, SDep &SrcDep, unsigned latency);42static bool zeroOutputDependences(SUnit &ISU, SDep &Dep);43unsigned makeBundleAssumptions(SUnit &ISU, SDep &Dep);44bool memoryRAWHazard(SUnit &ISU, SDep &Dep, unsigned latency);45};4647/// Note that you have to add:48/// DAG.addMutation(createARMLatencyMutation(ST, AA));49/// to ARMTargetMachine::createMachineScheduler() to have an effect.50std::unique_ptr<ScheduleDAGMutation>51createARMLatencyMutations(const class ARMSubtarget &, AAResults *AA);5253} // namespace llvm5455#endif565758