108bbd35aSDimitry Andric //===- TargetSubtargetInfo.cpp - General Target Information ----------------==//
2009b1c42SEd Schouten //
3e6d15924SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e6d15924SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5e6d15924SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6009b1c42SEd Schouten //
7009b1c42SEd Schouten //===----------------------------------------------------------------------===//
8009b1c42SEd Schouten //
9b915e9e0SDimitry Andric /// \file This file describes the general parts of a Subtarget.
10009b1c42SEd Schouten //
11009b1c42SEd Schouten //===----------------------------------------------------------------------===//
12009b1c42SEd Schouten
13044eb2f6SDimitry Andric #include "llvm/CodeGen/TargetSubtargetInfo.h"
1408bbd35aSDimitry Andric
15009b1c42SEd Schouten using namespace llvm;
16009b1c42SEd Schouten
TargetSubtargetInfo(const Triple & TT,StringRef CPU,StringRef TuneCPU,StringRef FS,ArrayRef<SubtargetFeatureKV> PF,ArrayRef<SubtargetSubTypeKV> PD,const MCWriteProcResEntry * WPR,const MCWriteLatencyEntry * WL,const MCReadAdvanceEntry * RA,const InstrStage * IS,const unsigned * OC,const unsigned * FP)17ee8648bdSDimitry Andric TargetSubtargetInfo::TargetSubtargetInfo(
18b60736ecSDimitry Andric const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS,
19e6d15924SDimitry Andric ArrayRef<SubtargetFeatureKV> PF, ArrayRef<SubtargetSubTypeKV> PD,
20b60736ecSDimitry Andric const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL,
21b60736ecSDimitry Andric const MCReadAdvanceEntry *RA, const InstrStage *IS, const unsigned *OC,
22b60736ecSDimitry Andric const unsigned *FP)
23b60736ecSDimitry Andric : MCSubtargetInfo(TT, CPU, TuneCPU, FS, PF, PD, WPR, WL, RA, IS, OC, FP) {}
24009b1c42SEd Schouten
2508bbd35aSDimitry Andric TargetSubtargetInfo::~TargetSubtargetInfo() = default;
26907da171SRoman Divacky
enableAtomicExpand() const2767c32a98SDimitry Andric bool TargetSubtargetInfo::enableAtomicExpand() const {
285ca98fd9SDimitry Andric return true;
295ca98fd9SDimitry Andric }
305ca98fd9SDimitry Andric
enableIndirectBrExpand() const31eb11fae6SDimitry Andric bool TargetSubtargetInfo::enableIndirectBrExpand() const {
32eb11fae6SDimitry Andric return false;
33eb11fae6SDimitry Andric }
34eb11fae6SDimitry Andric
enableMachineScheduler() const354a16efa3SDimitry Andric bool TargetSubtargetInfo::enableMachineScheduler() const {
364a16efa3SDimitry Andric return false;
374a16efa3SDimitry Andric }
384a16efa3SDimitry Andric
enableJoinGlobalCopies() const395a5ac124SDimitry Andric bool TargetSubtargetInfo::enableJoinGlobalCopies() const {
405a5ac124SDimitry Andric return enableMachineScheduler();
415a5ac124SDimitry Andric }
425a5ac124SDimitry Andric
enableRALocalReassignment(CodeGenOptLevel OptLevel) const435ca98fd9SDimitry Andric bool TargetSubtargetInfo::enableRALocalReassignment(
44b1c73532SDimitry Andric CodeGenOptLevel OptLevel) const {
455ca98fd9SDimitry Andric return true;
465ca98fd9SDimitry Andric }
475ca98fd9SDimitry Andric
enablePostRAScheduler() const483a0822f0SDimitry Andric bool TargetSubtargetInfo::enablePostRAScheduler() const {
4967c32a98SDimitry Andric return getSchedModel().PostRAScheduler;
50907da171SRoman Divacky }
51907da171SRoman Divacky
enablePostRAMachineScheduler() const52706b4fc4SDimitry Andric bool TargetSubtargetInfo::enablePostRAMachineScheduler() const {
53706b4fc4SDimitry Andric return enableMachineScheduler() && enablePostRAScheduler();
54706b4fc4SDimitry Andric }
55706b4fc4SDimitry Andric
useAA() const56f8af5cf6SDimitry Andric bool TargetSubtargetInfo::useAA() const {
57f8af5cf6SDimitry Andric return false;
58f8af5cf6SDimitry Andric }
5971d5a254SDimitry Andric
mirFileLoaded(MachineFunction & MF) const60e6d15924SDimitry Andric void TargetSubtargetInfo::mirFileLoaded(MachineFunction &MF) const { }
61