2017-06-20 00:43:19 +02:00
|
|
|
//===- HexagonSubtarget.cpp - Hexagon Subtarget Information ---------------===//
|
2011-12-12 22:14:40 +01:00
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// 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
|
2011-12-12 22:14:40 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the Hexagon specific subclass of TargetSubtarget.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-09-10 17:52:05 +02:00
|
|
|
#include "HexagonSubtarget.h"
|
2011-12-12 22:14:40 +01:00
|
|
|
#include "Hexagon.h"
|
2017-06-20 00:43:19 +02:00
|
|
|
#include "HexagonInstrInfo.h"
|
2012-05-10 22:20:25 +02:00
|
|
|
#include "HexagonRegisterInfo.h"
|
2018-03-20 13:28:43 +01:00
|
|
|
#include "MCTargetDesc/HexagonMCTargetDesc.h"
|
2017-06-20 00:43:19 +02:00
|
|
|
#include "llvm/ADT/STLExtras.h"
|
|
|
|
#include "llvm/ADT/SmallSet.h"
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
#include "llvm/CodeGen/MachineInstr.h"
|
|
|
|
#include "llvm/CodeGen/MachineOperand.h"
|
2018-03-20 13:28:43 +01:00
|
|
|
#include "llvm/CodeGen/MachineScheduler.h"
|
2016-07-15 19:48:09 +02:00
|
|
|
#include "llvm/CodeGen/ScheduleDAG.h"
|
|
|
|
#include "llvm/CodeGen/ScheduleDAGInstrs.h"
|
2011-12-12 22:14:40 +01:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
|
|
|
#include "llvm/Support/ErrorHandling.h"
|
2020-09-10 17:52:05 +02:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2017-06-20 00:43:19 +02:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cassert>
|
2015-11-25 21:30:59 +01:00
|
|
|
#include <map>
|
|
|
|
|
2011-12-12 22:14:40 +01:00
|
|
|
using namespace llvm;
|
|
|
|
|
2014-04-22 00:55:11 +02:00
|
|
|
#define DEBUG_TYPE "hexagon-subtarget"
|
|
|
|
|
2011-12-12 22:14:40 +01:00
|
|
|
#define GET_SUBTARGETINFO_CTOR
|
|
|
|
#define GET_SUBTARGETINFO_TARGET_DESC
|
|
|
|
#include "HexagonGenSubtargetInfo.inc"
|
|
|
|
|
2015-11-24 15:55:26 +01:00
|
|
|
static cl::opt<bool> EnableBSBSched("enable-bsb-sched",
|
2015-11-25 21:30:59 +01:00
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(true));
|
|
|
|
|
2016-07-15 23:34:02 +02:00
|
|
|
static cl::opt<bool> EnableTCLatencySched("enable-tc-latency-sched",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(false));
|
|
|
|
|
|
|
|
static cl::opt<bool> EnableDotCurSched("enable-cur-sched",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(true),
|
|
|
|
cl::desc("Enable the scheduler to generate .cur"));
|
|
|
|
|
2015-03-11 23:56:10 +01:00
|
|
|
static cl::opt<bool> DisableHexagonMISched("disable-hexagon-misched",
|
2015-11-25 21:30:59 +01:00
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
|
|
|
cl::desc("Disable Hexagon MI Scheduling"));
|
|
|
|
|
2016-05-28 04:02:51 +02:00
|
|
|
static cl::opt<bool> EnableSubregLiveness("hexagon-subreg-liveness",
|
2016-08-24 19:17:39 +02:00
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(true),
|
2016-05-28 04:02:51 +02:00
|
|
|
cl::desc("Enable subregister liveness tracking for Hexagon"));
|
|
|
|
|
2016-07-25 16:42:11 +02:00
|
|
|
static cl::opt<bool> OverrideLongCalls("hexagon-long-calls",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
|
|
|
cl::desc("If present, forces/disables the use of long calls"));
|
|
|
|
|
2017-05-06 00:13:57 +02:00
|
|
|
static cl::opt<bool> EnablePredicatedCalls("hexagon-pred-calls",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
|
|
|
cl::desc("Consider calls to be predicable"));
|
|
|
|
|
2017-08-28 18:24:22 +02:00
|
|
|
static cl::opt<bool> SchedPredsCloser("sched-preds-closer",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(true));
|
|
|
|
|
|
|
|
static cl::opt<bool> SchedRetvalOptimization("sched-retval-optimization",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(true));
|
|
|
|
|
2017-08-28 20:36:21 +02:00
|
|
|
static cl::opt<bool> EnableCheckBankConflict("hexagon-check-bank-conflict",
|
|
|
|
cl::Hidden, cl::ZeroOrMore, cl::init(true),
|
|
|
|
cl::desc("Enable checking for cache bank conflicts"));
|
|
|
|
|
2017-09-26 17:06:37 +02:00
|
|
|
HexagonSubtarget::HexagonSubtarget(const Triple &TT, StringRef CPU,
|
|
|
|
StringRef FS, const TargetMachine &TM)
|
2020-08-14 23:56:54 +02:00
|
|
|
: HexagonGenSubtargetInfo(TT, CPU, /*TuneCPU*/ CPU, FS),
|
|
|
|
OptLevel(TM.getOptLevel()),
|
2020-01-28 20:23:46 +01:00
|
|
|
CPUString(std::string(Hexagon_MC::selectHexagonCPU(CPU))),
|
|
|
|
TargetTriple(TT), InstrInfo(initializeSubtargetDependencies(CPU, FS)),
|
2017-09-26 17:06:37 +02:00
|
|
|
RegInfo(getHwMode()), TLInfo(TM, *this),
|
|
|
|
InstrItins(getInstrItineraryForCPU(CPUString)) {
|
2020-01-13 23:07:30 +01:00
|
|
|
Hexagon_MC::addArchSubtarget(this, FS);
|
2017-09-26 17:06:37 +02:00
|
|
|
// Beware of the default constructor of InstrItineraryData: it will
|
|
|
|
// reset all members to 0.
|
|
|
|
assert(InstrItins.Itineraries != nullptr && "InstrItins not initialized");
|
2015-11-25 21:30:59 +01:00
|
|
|
}
|
2015-03-11 23:56:10 +01:00
|
|
|
|
2014-06-27 02:27:40 +02:00
|
|
|
HexagonSubtarget &
|
|
|
|
HexagonSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) {
|
2020-01-17 23:29:40 +01:00
|
|
|
Optional<Hexagon::ArchEnum> ArchVer =
|
|
|
|
Hexagon::GetCpu(Hexagon::CpuTable, CPUString);
|
|
|
|
if (ArchVer)
|
|
|
|
HexagonArchVersion = *ArchVer;
|
2015-11-25 21:30:59 +01:00
|
|
|
else
|
2012-08-20 21:56:47 +02:00
|
|
|
llvm_unreachable("Unrecognized Hexagon processor version");
|
2011-12-12 22:14:40 +01:00
|
|
|
|
2017-10-18 20:07:07 +02:00
|
|
|
UseHVX128BOps = false;
|
|
|
|
UseHVX64BOps = false;
|
2020-01-17 23:29:40 +01:00
|
|
|
UseAudioOps = false;
|
2016-07-25 16:42:11 +02:00
|
|
|
UseLongCalls = false;
|
2017-09-26 17:06:37 +02:00
|
|
|
|
2018-06-20 15:56:09 +02:00
|
|
|
UseBSBScheduling = hasV60Ops() && EnableBSBSched;
|
2017-09-26 17:06:37 +02:00
|
|
|
|
2020-08-14 23:56:54 +02:00
|
|
|
ParseSubtargetFeatures(CPUString, /*TuneCPU*/ CPUString, FS);
|
2015-11-25 21:30:59 +01:00
|
|
|
|
2016-07-25 16:42:11 +02:00
|
|
|
if (OverrideLongCalls.getPosition())
|
|
|
|
UseLongCalls = OverrideLongCalls;
|
2015-11-25 21:30:59 +01:00
|
|
|
|
2020-01-13 23:07:30 +01:00
|
|
|
if (isTinyCore()) {
|
|
|
|
// Tiny core has a single thread, so back-to-back scheduling is enabled by
|
|
|
|
// default.
|
|
|
|
if (!EnableBSBSched.getPosition())
|
|
|
|
UseBSBScheduling = false;
|
|
|
|
}
|
|
|
|
|
2017-12-11 19:57:54 +01:00
|
|
|
FeatureBitset Features = getFeatureBits();
|
|
|
|
if (HexagonDisableDuplex)
|
2019-08-24 17:02:44 +02:00
|
|
|
setFeatureBits(Features.reset(Hexagon::FeatureDuplex));
|
2017-12-11 19:57:54 +01:00
|
|
|
setFeatureBits(Hexagon_MC::completeHVXFeatures(Features));
|
|
|
|
|
2014-06-27 02:27:40 +02:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2020-11-02 20:57:42 +01:00
|
|
|
bool HexagonSubtarget::isHVXElementType(MVT Ty, bool IncludeBool) const {
|
|
|
|
if (!useHVXOps())
|
|
|
|
return false;
|
|
|
|
if (Ty.isVector())
|
|
|
|
Ty = Ty.getVectorElementType();
|
|
|
|
if (IncludeBool && Ty == MVT::i1)
|
|
|
|
return true;
|
|
|
|
ArrayRef<MVT> ElemTypes = getHVXElementTypes();
|
2020-12-14 04:35:10 +01:00
|
|
|
return llvm::is_contained(ElemTypes, Ty);
|
2020-11-02 20:57:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool HexagonSubtarget::isHVXVectorType(MVT VecTy, bool IncludeBool) const {
|
|
|
|
if (!VecTy.isVector() || !useHVXOps() || VecTy.isScalableVector())
|
|
|
|
return false;
|
|
|
|
MVT ElemTy = VecTy.getVectorElementType();
|
|
|
|
if (!IncludeBool && ElemTy == MVT::i1)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
unsigned HwLen = getVectorLength();
|
|
|
|
unsigned NumElems = VecTy.getVectorNumElements();
|
|
|
|
ArrayRef<MVT> ElemTypes = getHVXElementTypes();
|
|
|
|
|
|
|
|
if (IncludeBool && ElemTy == MVT::i1) {
|
|
|
|
// Boolean HVX vector types are formed from regular HVX vector types
|
|
|
|
// by replacing the element type with i1.
|
|
|
|
for (MVT T : ElemTypes)
|
|
|
|
if (NumElems * T.getSizeInBits() == 8 * HwLen)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned VecWidth = VecTy.getSizeInBits();
|
|
|
|
if (VecWidth != 8 * HwLen && VecWidth != 16 * HwLen)
|
|
|
|
return false;
|
2020-12-14 04:35:10 +01:00
|
|
|
return llvm::is_contained(ElemTypes, ElemTy);
|
2020-11-02 20:57:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool HexagonSubtarget::isTypeForHVX(Type *VecTy, bool IncludeBool) const {
|
|
|
|
if (!VecTy->isVectorTy() || isa<ScalableVectorType>(VecTy))
|
|
|
|
return false;
|
|
|
|
// Avoid types like <2 x i32*>.
|
|
|
|
if (!cast<VectorType>(VecTy)->getElementType()->isIntegerTy())
|
|
|
|
return false;
|
2020-11-27 20:09:34 +01:00
|
|
|
// The given type may be something like <17 x i32>, which is not MVT,
|
|
|
|
// but can be represented as (non-simple) EVT.
|
2020-11-02 20:57:42 +01:00
|
|
|
EVT Ty = EVT::getEVT(VecTy, /*HandleUnknown*/false);
|
2020-11-27 20:09:34 +01:00
|
|
|
if (Ty.getSizeInBits() <= 64 || !Ty.getVectorElementType().isSimple())
|
2020-11-02 20:57:42 +01:00
|
|
|
return false;
|
2020-11-27 20:09:34 +01:00
|
|
|
|
|
|
|
auto isHvxTy = [this, IncludeBool](MVT SimpleTy) {
|
|
|
|
if (isHVXVectorType(SimpleTy, IncludeBool))
|
|
|
|
return true;
|
|
|
|
auto Action = getTargetLowering()->getPreferredVectorAction(SimpleTy);
|
|
|
|
return Action == TargetLoweringBase::TypeWidenVector;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Round up EVT to have power-of-2 elements, and keep checking if it
|
|
|
|
// qualifies for HVX, dividing it in half after each step.
|
|
|
|
MVT ElemTy = Ty.getVectorElementType().getSimpleVT();
|
|
|
|
unsigned VecLen = PowerOf2Ceil(Ty.getVectorNumElements());
|
|
|
|
while (ElemTy.getSizeInBits() * VecLen > 64) {
|
|
|
|
MVT SimpleTy = MVT::getVectorVT(ElemTy, VecLen);
|
|
|
|
if (SimpleTy.isValid() && isHvxTy(SimpleTy))
|
|
|
|
return true;
|
|
|
|
VecLen /= 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2020-11-02 20:57:42 +01:00
|
|
|
}
|
|
|
|
|
2017-08-28 18:24:22 +02:00
|
|
|
void HexagonSubtarget::UsrOverflowMutation::apply(ScheduleDAGInstrs *DAG) {
|
|
|
|
for (SUnit &SU : DAG->SUnits) {
|
|
|
|
if (!SU.isInstr())
|
|
|
|
continue;
|
|
|
|
SmallVector<SDep, 4> Erase;
|
|
|
|
for (auto &D : SU.Preds)
|
|
|
|
if (D.getKind() == SDep::Output && D.getReg() == Hexagon::USR_OVF)
|
|
|
|
Erase.push_back(D);
|
|
|
|
for (auto &E : Erase)
|
|
|
|
SU.removePred(E);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void HexagonSubtarget::HVXMemLatencyMutation::apply(ScheduleDAGInstrs *DAG) {
|
|
|
|
for (SUnit &SU : DAG->SUnits) {
|
|
|
|
// Update the latency of chain edges between v60 vector load or store
|
|
|
|
// instructions to be 1. These instruction cannot be scheduled in the
|
|
|
|
// same packet.
|
|
|
|
MachineInstr &MI1 = *SU.getInstr();
|
|
|
|
auto *QII = static_cast<const HexagonInstrInfo*>(DAG->TII);
|
|
|
|
bool IsStoreMI1 = MI1.mayStore();
|
|
|
|
bool IsLoadMI1 = MI1.mayLoad();
|
|
|
|
if (!QII->isHVXVec(MI1) || !(IsStoreMI1 || IsLoadMI1))
|
|
|
|
continue;
|
|
|
|
for (SDep &SI : SU.Succs) {
|
|
|
|
if (SI.getKind() != SDep::Order || SI.getLatency() != 0)
|
|
|
|
continue;
|
|
|
|
MachineInstr &MI2 = *SI.getSUnit()->getInstr();
|
|
|
|
if (!QII->isHVXVec(MI2))
|
|
|
|
continue;
|
|
|
|
if ((IsStoreMI1 && MI2.mayStore()) || (IsLoadMI1 && MI2.mayLoad())) {
|
|
|
|
SI.setLatency(1);
|
|
|
|
SU.setHeightDirty();
|
|
|
|
// Change the dependence in the opposite direction too.
|
|
|
|
for (SDep &PI : SI.getSUnit()->Preds) {
|
|
|
|
if (PI.getSUnit() != &SU || PI.getKind() != SDep::Order)
|
|
|
|
continue;
|
|
|
|
PI.setLatency(1);
|
|
|
|
SI.getSUnit()->setDepthDirty();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if a call and subsequent A2_tfrpi instructions should maintain
|
|
|
|
// scheduling affinity. We are looking for the TFRI to be consumed in
|
|
|
|
// the next instruction. This should help reduce the instances of
|
|
|
|
// double register pairs being allocated and scheduled before a call
|
|
|
|
// when not used until after the call. This situation is exacerbated
|
|
|
|
// by the fact that we allocate the pair from the callee saves list,
|
|
|
|
// leading to excess spills and restores.
|
|
|
|
bool HexagonSubtarget::CallMutation::shouldTFRICallBind(
|
|
|
|
const HexagonInstrInfo &HII, const SUnit &Inst1,
|
|
|
|
const SUnit &Inst2) const {
|
|
|
|
if (Inst1.getInstr()->getOpcode() != Hexagon::A2_tfrpi)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// TypeXTYPE are 64 bit operations.
|
|
|
|
unsigned Type = HII.getType(*Inst2.getInstr());
|
|
|
|
return Type == HexagonII::TypeS_2op || Type == HexagonII::TypeS_3op ||
|
|
|
|
Type == HexagonII::TypeALU64 || Type == HexagonII::TypeM;
|
|
|
|
}
|
|
|
|
|
2018-03-20 13:28:43 +01:00
|
|
|
void HexagonSubtarget::CallMutation::apply(ScheduleDAGInstrs *DAGInstrs) {
|
|
|
|
ScheduleDAGMI *DAG = static_cast<ScheduleDAGMI*>(DAGInstrs);
|
2017-08-28 18:24:22 +02:00
|
|
|
SUnit* LastSequentialCall = nullptr;
|
2018-03-21 18:23:32 +01:00
|
|
|
// Map from virtual register to physical register from the copy.
|
|
|
|
DenseMap<unsigned, unsigned> VRegHoldingReg;
|
|
|
|
// Map from the physical register to the instruction that uses virtual
|
|
|
|
// register. This is used to create the barrier edge.
|
|
|
|
DenseMap<unsigned, SUnit *> LastVRegUse;
|
2017-08-28 18:24:22 +02:00
|
|
|
auto &TRI = *DAG->MF.getSubtarget().getRegisterInfo();
|
|
|
|
auto &HII = *DAG->MF.getSubtarget<HexagonSubtarget>().getInstrInfo();
|
|
|
|
|
|
|
|
// Currently we only catch the situation when compare gets scheduled
|
|
|
|
// before preceding call.
|
|
|
|
for (unsigned su = 0, e = DAG->SUnits.size(); su != e; ++su) {
|
|
|
|
// Remember the call.
|
|
|
|
if (DAG->SUnits[su].getInstr()->isCall())
|
|
|
|
LastSequentialCall = &DAG->SUnits[su];
|
|
|
|
// Look for a compare that defines a predicate.
|
|
|
|
else if (DAG->SUnits[su].getInstr()->isCompare() && LastSequentialCall)
|
2018-03-20 13:28:43 +01:00
|
|
|
DAG->addEdge(&DAG->SUnits[su], SDep(LastSequentialCall, SDep::Barrier));
|
2017-08-28 18:24:22 +02:00
|
|
|
// Look for call and tfri* instructions.
|
|
|
|
else if (SchedPredsCloser && LastSequentialCall && su > 1 && su < e-1 &&
|
|
|
|
shouldTFRICallBind(HII, DAG->SUnits[su], DAG->SUnits[su+1]))
|
2018-03-20 13:28:43 +01:00
|
|
|
DAG->addEdge(&DAG->SUnits[su], SDep(&DAG->SUnits[su-1], SDep::Barrier));
|
2018-03-21 18:23:32 +01:00
|
|
|
// Prevent redundant register copies due to reads and writes of physical
|
|
|
|
// registers. The original motivation for this was the code generated
|
|
|
|
// between two calls, which are caused both the return value and the
|
|
|
|
// argument for the next call being in %r0.
|
2017-08-28 18:24:22 +02:00
|
|
|
// Example:
|
|
|
|
// 1: <call1>
|
2017-11-30 13:12:19 +01:00
|
|
|
// 2: %vreg = COPY %r0
|
|
|
|
// 3: <use of %vreg>
|
2017-11-28 18:15:09 +01:00
|
|
|
// 4: %r0 = ...
|
2017-08-28 18:24:22 +02:00
|
|
|
// 5: <call2>
|
|
|
|
// The scheduler would often swap 3 and 4, so an additional register is
|
|
|
|
// needed. This code inserts a Barrier dependence between 3 & 4 to prevent
|
2018-03-21 18:23:32 +01:00
|
|
|
// this.
|
|
|
|
// The code below checks for all the physical registers, not just R0/D0/V0.
|
2017-08-28 18:24:22 +02:00
|
|
|
else if (SchedRetvalOptimization) {
|
|
|
|
const MachineInstr *MI = DAG->SUnits[su].getInstr();
|
2018-03-21 18:23:32 +01:00
|
|
|
if (MI->isCopy() &&
|
2019-08-02 01:27:28 +02:00
|
|
|
Register::isPhysicalRegister(MI->getOperand(1).getReg())) {
|
2018-03-21 18:23:32 +01:00
|
|
|
// %vregX = COPY %r0
|
|
|
|
VRegHoldingReg[MI->getOperand(0).getReg()] = MI->getOperand(1).getReg();
|
|
|
|
LastVRegUse.erase(MI->getOperand(1).getReg());
|
|
|
|
} else {
|
|
|
|
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
|
|
|
const MachineOperand &MO = MI->getOperand(i);
|
|
|
|
if (!MO.isReg())
|
|
|
|
continue;
|
|
|
|
if (MO.isUse() && !MI->isCopy() &&
|
|
|
|
VRegHoldingReg.count(MO.getReg())) {
|
|
|
|
// <use of %vregX>
|
|
|
|
LastVRegUse[VRegHoldingReg[MO.getReg()]] = &DAG->SUnits[su];
|
2019-08-02 01:27:28 +02:00
|
|
|
} else if (MO.isDef() && Register::isPhysicalRegister(MO.getReg())) {
|
2018-03-21 18:23:32 +01:00
|
|
|
for (MCRegAliasIterator AI(MO.getReg(), &TRI, true); AI.isValid();
|
|
|
|
++AI) {
|
|
|
|
if (LastVRegUse.count(*AI) &&
|
|
|
|
LastVRegUse[*AI] != &DAG->SUnits[su])
|
|
|
|
// %r0 = ...
|
|
|
|
DAG->addEdge(&DAG->SUnits[su], SDep(LastVRegUse[*AI], SDep::Barrier));
|
|
|
|
LastVRegUse.erase(*AI);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-08-28 18:24:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-28 20:36:21 +02:00
|
|
|
void HexagonSubtarget::BankConflictMutation::apply(ScheduleDAGInstrs *DAG) {
|
|
|
|
if (!EnableCheckBankConflict)
|
|
|
|
return;
|
|
|
|
|
|
|
|
const auto &HII = static_cast<const HexagonInstrInfo&>(*DAG->TII);
|
|
|
|
|
|
|
|
// Create artificial edges between loads that could likely cause a bank
|
|
|
|
// conflict. Since such loads would normally not have any dependency
|
|
|
|
// between them, we cannot rely on existing edges.
|
|
|
|
for (unsigned i = 0, e = DAG->SUnits.size(); i != e; ++i) {
|
|
|
|
SUnit &S0 = DAG->SUnits[i];
|
|
|
|
MachineInstr &L0 = *S0.getInstr();
|
|
|
|
if (!L0.mayLoad() || L0.mayStore() ||
|
|
|
|
HII.getAddrMode(L0) != HexagonII::BaseImmOffset)
|
|
|
|
continue;
|
2018-11-28 13:00:20 +01:00
|
|
|
int64_t Offset0;
|
2017-08-28 20:36:21 +02:00
|
|
|
unsigned Size0;
|
2018-11-28 13:00:20 +01:00
|
|
|
MachineOperand *BaseOp0 = HII.getBaseAndOffset(L0, Offset0, Size0);
|
2017-08-28 20:36:21 +02:00
|
|
|
// Is the access size is longer than the L1 cache line, skip the check.
|
2018-11-28 13:00:20 +01:00
|
|
|
if (BaseOp0 == nullptr || !BaseOp0->isReg() || Size0 >= 32)
|
2017-08-28 20:36:21 +02:00
|
|
|
continue;
|
|
|
|
// Scan only up to 32 instructions ahead (to avoid n^2 complexity).
|
|
|
|
for (unsigned j = i+1, m = std::min(i+32, e); j != m; ++j) {
|
|
|
|
SUnit &S1 = DAG->SUnits[j];
|
|
|
|
MachineInstr &L1 = *S1.getInstr();
|
|
|
|
if (!L1.mayLoad() || L1.mayStore() ||
|
|
|
|
HII.getAddrMode(L1) != HexagonII::BaseImmOffset)
|
|
|
|
continue;
|
2018-11-28 13:00:20 +01:00
|
|
|
int64_t Offset1;
|
2017-08-28 20:36:21 +02:00
|
|
|
unsigned Size1;
|
2018-11-28 13:00:20 +01:00
|
|
|
MachineOperand *BaseOp1 = HII.getBaseAndOffset(L1, Offset1, Size1);
|
|
|
|
if (BaseOp1 == nullptr || !BaseOp1->isReg() || Size1 >= 32 ||
|
|
|
|
BaseOp0->getReg() != BaseOp1->getReg())
|
2017-08-28 20:36:21 +02:00
|
|
|
continue;
|
|
|
|
// Check bits 3 and 4 of the offset: if they differ, a bank conflict
|
|
|
|
// is unlikely.
|
|
|
|
if (((Offset0 ^ Offset1) & 0x18) != 0)
|
|
|
|
continue;
|
|
|
|
// Bits 3 and 4 are the same, add an artificial edge and set extra
|
|
|
|
// latency.
|
|
|
|
SDep A(&S0, SDep::Artificial);
|
|
|
|
A.setLatency(1);
|
|
|
|
S1.addPred(A, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Enable use of alias analysis during code generation (during MI
|
2017-11-30 22:25:28 +01:00
|
|
|
/// scheduling, DAGCombine, etc.).
|
|
|
|
bool HexagonSubtarget::useAA() const {
|
|
|
|
if (OptLevel != CodeGenOpt::None)
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-05-01 17:54:18 +02:00
|
|
|
/// Perform target specific adjustments to the latency of a schedule
|
2017-05-03 22:10:36 +02:00
|
|
|
/// dependency.
|
2020-03-31 12:57:51 +02:00
|
|
|
void HexagonSubtarget::adjustSchedDependency(SUnit *Src, int SrcOpIdx,
|
|
|
|
SUnit *Dst, int DstOpIdx,
|
2017-05-03 22:10:36 +02:00
|
|
|
SDep &Dep) const {
|
|
|
|
if (!Src->isInstr() || !Dst->isInstr())
|
|
|
|
return;
|
|
|
|
|
2020-05-14 15:38:25 +02:00
|
|
|
MachineInstr *SrcInst = Src->getInstr();
|
|
|
|
MachineInstr *DstInst = Dst->getInstr();
|
2017-05-03 22:10:36 +02:00
|
|
|
const HexagonInstrInfo *QII = getInstrInfo();
|
|
|
|
|
|
|
|
// Instructions with .new operands have zero latency.
|
|
|
|
SmallSet<SUnit *, 4> ExclSrc;
|
|
|
|
SmallSet<SUnit *, 4> ExclDst;
|
|
|
|
if (QII->canExecuteInBundle(*SrcInst, *DstInst) &&
|
|
|
|
isBestZeroLatency(Src, Dst, QII, ExclSrc, ExclDst)) {
|
|
|
|
Dep.setLatency(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-06-20 15:56:09 +02:00
|
|
|
if (!hasV60Ops())
|
2017-05-03 22:10:36 +02:00
|
|
|
return;
|
|
|
|
|
2018-03-26 18:33:16 +02:00
|
|
|
// Set the latency for a copy to zero since we hope that is will get removed.
|
|
|
|
if (DstInst->isCopy())
|
|
|
|
Dep.setLatency(0);
|
|
|
|
|
|
|
|
// If it's a REG_SEQUENCE/COPY, use its destination instruction to determine
|
2017-05-03 22:10:36 +02:00
|
|
|
// the correct latency.
|
2018-03-26 18:33:16 +02:00
|
|
|
if ((DstInst->isRegSequence() || DstInst->isCopy()) && Dst->NumSuccs == 1) {
|
Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).
Partial reverts in:
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
X86FixupLEAs.cpp - Some functions return unsigned and arguably should be MCRegister
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
HexagonBitSimplify.cpp - Function takes BitTracker::RegisterRef which appears to be unsigned&
MachineVerifier.cpp - Ambiguous operator==() given MCRegister and const Register
PPCFastISel.cpp - No Register::operator-=()
PeepholeOptimizer.cpp - TargetInstrInfo::optimizeLoadInstr() takes an unsigned&
MachineTraceMetrics.cpp - MachineTraceMetrics lacks a suitable constructor
Manual fixups in:
ARMFastISel.cpp - ARMEmitLoad() now takes a Register& instead of unsigned&
HexagonSplitDouble.cpp - Ternary operator was ambiguous between unsigned/Register
HexagonConstExtenders.cpp - Has a local class named Register, used llvm::Register instead of Register.
PPCFastISel.cpp - PPCEmitLoad() now takes a Register& instead of unsigned&
Depends on D65919
Reviewers: arsenm, bogner, craig.topper, RKSimon
Reviewed By: arsenm
Subscribers: RKSimon, craig.topper, lenary, aemerson, wuzish, jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65962
llvm-svn: 369041
2019-08-15 21:22:08 +02:00
|
|
|
Register DReg = DstInst->getOperand(0).getReg();
|
2018-03-26 18:33:16 +02:00
|
|
|
MachineInstr *DDst = Dst->Succs[0].getSUnit()->getInstr();
|
2017-05-03 22:10:36 +02:00
|
|
|
unsigned UseIdx = -1;
|
2018-03-26 18:33:16 +02:00
|
|
|
for (unsigned OpNum = 0; OpNum < DDst->getNumOperands(); OpNum++) {
|
|
|
|
const MachineOperand &MO = DDst->getOperand(OpNum);
|
|
|
|
if (MO.isReg() && MO.getReg() && MO.isUse() && MO.getReg() == DReg) {
|
2017-05-03 22:10:36 +02:00
|
|
|
UseIdx = OpNum;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2018-03-26 18:33:16 +02:00
|
|
|
int DLatency = (InstrInfo.getOperandLatency(&InstrItins, *SrcInst,
|
|
|
|
0, *DDst, UseIdx));
|
|
|
|
DLatency = std::max(DLatency, 0);
|
|
|
|
Dep.setLatency((unsigned)DLatency);
|
2017-05-03 22:10:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Try to schedule uses near definitions to generate .cur.
|
|
|
|
ExclSrc.clear();
|
|
|
|
ExclDst.clear();
|
|
|
|
if (EnableDotCurSched && QII->isToBeScheduledASAP(*SrcInst, *DstInst) &&
|
|
|
|
isBestZeroLatency(Src, Dst, QII, ExclSrc, ExclDst)) {
|
|
|
|
Dep.setLatency(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
updateLatency(*SrcInst, *DstInst, Dep);
|
|
|
|
}
|
|
|
|
|
2016-07-15 19:48:09 +02:00
|
|
|
void HexagonSubtarget::getPostRAMutations(
|
2017-06-20 00:43:19 +02:00
|
|
|
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
|
2019-08-15 17:54:37 +02:00
|
|
|
Mutations.push_back(std::make_unique<UsrOverflowMutation>());
|
|
|
|
Mutations.push_back(std::make_unique<HVXMemLatencyMutation>());
|
|
|
|
Mutations.push_back(std::make_unique<BankConflictMutation>());
|
2016-07-15 19:48:09 +02:00
|
|
|
}
|
|
|
|
|
2016-12-22 20:44:55 +01:00
|
|
|
void HexagonSubtarget::getSMSMutations(
|
2017-06-20 00:43:19 +02:00
|
|
|
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
|
2019-08-15 17:54:37 +02:00
|
|
|
Mutations.push_back(std::make_unique<UsrOverflowMutation>());
|
|
|
|
Mutations.push_back(std::make_unique<HVXMemLatencyMutation>());
|
2016-12-22 20:44:55 +01:00
|
|
|
}
|
|
|
|
|
2013-11-19 01:57:56 +01:00
|
|
|
// Pin the vtable to this file.
|
|
|
|
void HexagonSubtarget::anchor() {}
|
2015-03-11 23:56:10 +01:00
|
|
|
|
|
|
|
bool HexagonSubtarget::enableMachineScheduler() const {
|
|
|
|
if (DisableHexagonMISched.getNumOccurrences())
|
|
|
|
return !DisableHexagonMISched;
|
|
|
|
return true;
|
|
|
|
}
|
2016-05-28 04:02:51 +02:00
|
|
|
|
2017-05-06 00:13:57 +02:00
|
|
|
bool HexagonSubtarget::usePredicatedCalls() const {
|
|
|
|
return EnablePredicatedCalls;
|
|
|
|
}
|
|
|
|
|
2016-07-29 23:49:42 +02:00
|
|
|
void HexagonSubtarget::updateLatency(MachineInstr &SrcInst,
|
|
|
|
MachineInstr &DstInst, SDep &Dep) const {
|
2017-05-03 22:10:36 +02:00
|
|
|
if (Dep.isArtificial()) {
|
|
|
|
Dep.setLatency(1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-06-20 15:56:09 +02:00
|
|
|
if (!hasV60Ops())
|
2016-07-15 23:34:02 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
auto &QII = static_cast<const HexagonInstrInfo&>(*getInstrInfo());
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
// BSB scheduling.
|
|
|
|
if (QII.isHVXVec(SrcInst) || useBSBScheduling())
|
|
|
|
Dep.setLatency((Dep.getLatency() + 1) >> 1);
|
2016-07-15 23:34:02 +02:00
|
|
|
}
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
void HexagonSubtarget::restoreLatency(SUnit *Src, SUnit *Dst) const {
|
|
|
|
MachineInstr *SrcI = Src->getInstr();
|
|
|
|
for (auto &I : Src->Succs) {
|
|
|
|
if (!I.isAssignedRegDep() || I.getSUnit() != Dst)
|
|
|
|
continue;
|
2020-11-05 04:10:29 +01:00
|
|
|
Register DepR = I.getReg();
|
2017-05-03 22:10:36 +02:00
|
|
|
int DefIdx = -1;
|
|
|
|
for (unsigned OpNum = 0; OpNum < SrcI->getNumOperands(); OpNum++) {
|
|
|
|
const MachineOperand &MO = SrcI->getOperand(OpNum);
|
2019-07-31 08:17:38 +02:00
|
|
|
bool IsSameOrSubReg = false;
|
|
|
|
if (MO.isReg()) {
|
2020-11-05 04:10:29 +01:00
|
|
|
Register MOReg = MO.getReg();
|
|
|
|
if (DepR.isVirtual()) {
|
2019-07-31 08:17:38 +02:00
|
|
|
IsSameOrSubReg = (MOReg == DepR);
|
|
|
|
} else {
|
|
|
|
IsSameOrSubReg = getRegisterInfo()->isSubRegisterEq(DepR, MOReg);
|
|
|
|
}
|
|
|
|
if (MO.isDef() && IsSameOrSubReg)
|
|
|
|
DefIdx = OpNum;
|
|
|
|
}
|
2017-05-03 22:10:36 +02:00
|
|
|
}
|
|
|
|
assert(DefIdx >= 0 && "Def Reg not found in Src MI");
|
|
|
|
MachineInstr *DstI = Dst->getInstr();
|
2018-03-26 21:04:58 +02:00
|
|
|
SDep T = I;
|
2017-05-03 22:10:36 +02:00
|
|
|
for (unsigned OpNum = 0; OpNum < DstI->getNumOperands(); OpNum++) {
|
|
|
|
const MachineOperand &MO = DstI->getOperand(OpNum);
|
|
|
|
if (MO.isReg() && MO.isUse() && MO.getReg() == DepR) {
|
|
|
|
int Latency = (InstrInfo.getOperandLatency(&InstrItins, *SrcI,
|
|
|
|
DefIdx, *DstI, OpNum));
|
|
|
|
|
|
|
|
// For some instructions (ex: COPY), we might end up with < 0 latency
|
|
|
|
// as they don't have any Itinerary class associated with them.
|
2018-03-26 18:33:16 +02:00
|
|
|
Latency = std::max(Latency, 0);
|
2017-05-03 22:10:36 +02:00
|
|
|
|
|
|
|
I.setLatency(Latency);
|
|
|
|
updateLatency(*SrcI, *DstI, I);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update the latency of opposite edge too.
|
2018-03-26 21:04:58 +02:00
|
|
|
T.setSUnit(Src);
|
2021-01-20 05:19:14 +01:00
|
|
|
auto F = find(Dst->Preds, T);
|
2018-03-26 21:04:58 +02:00
|
|
|
assert(F != Dst->Preds.end());
|
|
|
|
F->setLatency(I.getLatency());
|
2017-05-03 22:10:36 +02:00
|
|
|
}
|
2016-07-18 16:23:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Change the latency between the two SUnits.
|
2017-05-03 22:10:36 +02:00
|
|
|
void HexagonSubtarget::changeLatency(SUnit *Src, SUnit *Dst, unsigned Lat)
|
|
|
|
const {
|
|
|
|
for (auto &I : Src->Succs) {
|
2018-03-26 21:04:58 +02:00
|
|
|
if (!I.isAssignedRegDep() || I.getSUnit() != Dst)
|
2016-07-18 16:23:10 +02:00
|
|
|
continue;
|
2017-05-03 22:10:36 +02:00
|
|
|
SDep T = I;
|
2016-07-18 16:23:10 +02:00
|
|
|
I.setLatency(Lat);
|
2017-05-03 22:10:36 +02:00
|
|
|
|
2016-07-18 16:23:10 +02:00
|
|
|
// Update the latency of opposite edge too.
|
2017-05-03 22:10:36 +02:00
|
|
|
T.setSUnit(Src);
|
2021-01-20 05:19:14 +01:00
|
|
|
auto F = find(Dst->Preds, T);
|
2017-05-03 22:10:36 +02:00
|
|
|
assert(F != Dst->Preds.end());
|
2018-03-26 21:04:58 +02:00
|
|
|
F->setLatency(Lat);
|
2016-07-18 16:23:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
/// If the SUnit has a zero latency edge, return the other SUnit.
|
|
|
|
static SUnit *getZeroLatency(SUnit *N, SmallVector<SDep, 4> &Deps) {
|
|
|
|
for (auto &I : Deps)
|
|
|
|
if (I.isAssignedRegDep() && I.getLatency() == 0 &&
|
|
|
|
!I.getSUnit()->getInstr()->isPseudo())
|
|
|
|
return I.getSUnit();
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2016-07-15 23:34:02 +02:00
|
|
|
// Return true if these are the best two instructions to schedule
|
|
|
|
// together with a zero latency. Only one dependence should have a zero
|
|
|
|
// latency. If there are multiple choices, choose the best, and change
|
2017-05-03 22:10:36 +02:00
|
|
|
// the others, if needed.
|
2016-07-15 23:34:02 +02:00
|
|
|
bool HexagonSubtarget::isBestZeroLatency(SUnit *Src, SUnit *Dst,
|
2017-05-03 22:10:36 +02:00
|
|
|
const HexagonInstrInfo *TII, SmallSet<SUnit*, 4> &ExclSrc,
|
|
|
|
SmallSet<SUnit*, 4> &ExclDst) const {
|
2016-07-29 23:49:42 +02:00
|
|
|
MachineInstr &SrcInst = *Src->getInstr();
|
|
|
|
MachineInstr &DstInst = *Dst->getInstr();
|
2016-07-15 23:34:02 +02:00
|
|
|
|
2016-09-17 18:21:09 +02:00
|
|
|
// Ignore Boundary SU nodes as these have null instructions.
|
|
|
|
if (Dst->isBoundaryNode())
|
|
|
|
return false;
|
|
|
|
|
2016-07-29 23:49:42 +02:00
|
|
|
if (SrcInst.isPHI() || DstInst.isPHI())
|
2016-07-15 23:34:02 +02:00
|
|
|
return false;
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
if (!TII->isToBeScheduledASAP(SrcInst, DstInst) &&
|
|
|
|
!TII->canExecuteInBundle(SrcInst, DstInst))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// The architecture doesn't allow three dependent instructions in the same
|
|
|
|
// packet. So, if the destination has a zero latency successor, then it's
|
|
|
|
// not a candidate for a zero latency predecessor.
|
|
|
|
if (getZeroLatency(Dst, Dst->Succs) != nullptr)
|
|
|
|
return false;
|
|
|
|
|
2016-07-18 16:23:10 +02:00
|
|
|
// Check if the Dst instruction is the best candidate first.
|
|
|
|
SUnit *Best = nullptr;
|
|
|
|
SUnit *DstBest = nullptr;
|
|
|
|
SUnit *SrcBest = getZeroLatency(Dst, Dst->Preds);
|
|
|
|
if (SrcBest == nullptr || Src->NodeNum >= SrcBest->NodeNum) {
|
|
|
|
// Check that Src doesn't have a better candidate.
|
|
|
|
DstBest = getZeroLatency(Src, Src->Succs);
|
|
|
|
if (DstBest == nullptr || Dst->NodeNum <= DstBest->NodeNum)
|
|
|
|
Best = Dst;
|
2016-07-15 23:34:02 +02:00
|
|
|
}
|
2016-07-18 16:23:10 +02:00
|
|
|
if (Best != Dst)
|
|
|
|
return false;
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
// The caller frequently adds the same dependence twice. If so, then
|
2016-07-18 16:23:10 +02:00
|
|
|
// return true for this case too.
|
2017-05-03 22:10:36 +02:00
|
|
|
if ((Src == SrcBest && Dst == DstBest ) ||
|
|
|
|
(SrcBest == nullptr && Dst == DstBest) ||
|
|
|
|
(Src == SrcBest && Dst == nullptr))
|
2016-07-18 16:23:10 +02:00
|
|
|
return true;
|
2016-07-15 23:34:02 +02:00
|
|
|
|
2016-07-18 16:23:10 +02:00
|
|
|
// Reassign the latency for the previous bests, which requires setting
|
2016-07-15 23:34:02 +02:00
|
|
|
// the dependence edge in both directions.
|
2017-05-03 22:10:36 +02:00
|
|
|
if (SrcBest != nullptr) {
|
2018-06-20 15:56:09 +02:00
|
|
|
if (!hasV60Ops())
|
2017-05-03 22:10:36 +02:00
|
|
|
changeLatency(SrcBest, Dst, 1);
|
|
|
|
else
|
|
|
|
restoreLatency(SrcBest, Dst);
|
2016-07-15 23:34:02 +02:00
|
|
|
}
|
2017-05-03 22:10:36 +02:00
|
|
|
if (DstBest != nullptr) {
|
2018-06-20 15:56:09 +02:00
|
|
|
if (!hasV60Ops())
|
2017-05-03 22:10:36 +02:00
|
|
|
changeLatency(Src, DstBest, 1);
|
|
|
|
else
|
|
|
|
restoreLatency(Src, DstBest);
|
2016-07-15 23:34:02 +02:00
|
|
|
}
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
// Attempt to find another opprotunity for zero latency in a different
|
|
|
|
// dependence.
|
|
|
|
if (SrcBest && DstBest)
|
|
|
|
// If there is an edge from SrcBest to DstBst, then try to change that
|
|
|
|
// to 0 now.
|
|
|
|
changeLatency(SrcBest, DstBest, 0);
|
|
|
|
else if (DstBest) {
|
|
|
|
// Check if the previous best destination instruction has a new zero
|
|
|
|
// latency dependence opportunity.
|
|
|
|
ExclSrc.insert(Src);
|
|
|
|
for (auto &I : DstBest->Preds)
|
|
|
|
if (ExclSrc.count(I.getSUnit()) == 0 &&
|
|
|
|
isBestZeroLatency(I.getSUnit(), DstBest, TII, ExclSrc, ExclDst))
|
|
|
|
changeLatency(I.getSUnit(), DstBest, 0);
|
|
|
|
} else if (SrcBest) {
|
|
|
|
// Check if previous best source instruction has a new zero latency
|
|
|
|
// dependence opportunity.
|
|
|
|
ExclDst.insert(Dst);
|
|
|
|
for (auto &I : SrcBest->Succs)
|
|
|
|
if (ExclDst.count(I.getSUnit()) == 0 &&
|
|
|
|
isBestZeroLatency(SrcBest, I.getSUnit(), TII, ExclSrc, ExclDst))
|
|
|
|
changeLatency(SrcBest, I.getSUnit(), 0);
|
2016-07-15 23:34:02 +02:00
|
|
|
}
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
return true;
|
2016-07-15 23:34:02 +02:00
|
|
|
}
|
|
|
|
|
2016-07-22 16:22:43 +02:00
|
|
|
unsigned HexagonSubtarget::getL1CacheLineSize() const {
|
|
|
|
return 32;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned HexagonSubtarget::getL1PrefetchDistance() const {
|
|
|
|
return 32;
|
|
|
|
}
|
|
|
|
|
2017-05-03 22:10:36 +02:00
|
|
|
bool HexagonSubtarget::enableSubRegLiveness() const {
|
|
|
|
return EnableSubregLiveness;
|
|
|
|
}
|