You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
eng
libcxx
libcxxabi
libunwind
lld
lldb
llvm
bindings
cmake
docs
examples
include
lib
Analysis
AsmParser
BinaryFormat
Bitcode
CodeGen
DebugInfo
Demangle
ExecutionEngine
FuzzMutate
Fuzzer
IR
IRReader
LTO
LineEditor
Linker
MC
Object
ObjectYAML
Option
Passes
ProfileData
Support
TableGen
Target
AArch64
AMDGPU
ARC
ARM
AsmParser
Disassembler
InstPrinter
MCTargetDesc
TargetInfo
Utils
A15SDOptimizer.cpp
ARM.h
ARM.td
ARMAsmPrinter.cpp
ARMAsmPrinter.h
ARMBaseInstrInfo.cpp.REMOVED.git-id
ARMBaseInstrInfo.h
ARMBaseRegisterInfo.cpp
ARMBaseRegisterInfo.h
ARMBasicBlockInfo.h
ARMCallLowering.cpp
ARMCallLowering.h
ARMCallingConv.h
ARMCallingConv.td
ARMComputeBlockSize.cpp
ARMConstantIslandPass.cpp
ARMConstantPoolValue.cpp
ARMConstantPoolValue.h
ARMExpandPseudoInsts.cpp
ARMFastISel.cpp.REMOVED.git-id
ARMFeatures.h
ARMFrameLowering.cpp
ARMFrameLowering.h
ARMHazardRecognizer.cpp
ARMHazardRecognizer.h
ARMISelDAGToDAG.cpp.REMOVED.git-id
ARMISelLowering.cpp.REMOVED.git-id
ARMISelLowering.h
ARMInstrFormats.td
ARMInstrInfo.cpp
ARMInstrInfo.h
ARMInstrInfo.td.REMOVED.git-id
ARMInstrNEON.td.REMOVED.git-id
ARMInstrThumb.td
ARMInstrThumb2.td.REMOVED.git-id
ARMInstrVFP.td
ARMInstructionSelector.cpp
ARMLegalizerInfo.cpp
ARMLegalizerInfo.h
ARMLoadStoreOptimizer.cpp
ARMMCInstLower.cpp
ARMMachineFunctionInfo.cpp
ARMMachineFunctionInfo.h
ARMMacroFusion.cpp
ARMMacroFusion.h
ARMOptimizeBarriersPass.cpp
ARMPerfectShuffle.h.REMOVED.git-id
ARMRegisterBankInfo.cpp
ARMRegisterBankInfo.h
ARMRegisterBanks.td
ARMRegisterInfo.cpp
ARMRegisterInfo.h
ARMRegisterInfo.td
ARMSchedule.td
ARMScheduleA57.td
ARMScheduleA57WriteRes.td
ARMScheduleA8.td
ARMScheduleA9.td.REMOVED.git-id
ARMScheduleM3.td
ARMScheduleR52.td
ARMScheduleSwift.td
ARMScheduleV6.td
ARMSelectionDAGInfo.cpp
ARMSelectionDAGInfo.h
ARMSubtarget.cpp
ARMSubtarget.h
ARMSystemRegister.td
ARMTargetMachine.cpp
ARMTargetMachine.h
ARMTargetObjectFile.cpp
ARMTargetObjectFile.h
ARMTargetTransformInfo.cpp
ARMTargetTransformInfo.h
CMakeLists.txt
LICENSE.TXT
LLVMBuild.txt
MLxExpansionPass.cpp
README-Thumb.txt
README-Thumb2.txt
README.txt
Thumb1FrameLowering.cpp
Thumb1FrameLowering.h
Thumb1InstrInfo.cpp
Thumb1InstrInfo.h
Thumb2ITBlockPass.cpp
Thumb2InstrInfo.cpp
Thumb2InstrInfo.h
Thumb2SizeReduction.cpp
ThumbRegisterInfo.cpp
ThumbRegisterInfo.h
AVR
BPF
Hexagon
Lanai
MSP430
Mips
NVPTX
Nios2
PowerPC
RISCV
Sparc
SystemZ
WebAssembly
X86
XCore
CMakeLists.txt
LLVMBuild.txt
README.txt
Target.cpp
TargetIntrinsicInfo.cpp
TargetLoweringObjectFile.cpp
TargetMachine.cpp
TargetMachineC.cpp
Testing
ToolDrivers
Transforms
WindowsManifest
XRay
CMakeLists.txt
LLVMBuild.txt
projects
resources
runtimes
scripts
test
tools
unittests
utils
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
version.txt.in
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
192 lines
6.8 KiB
C
192 lines
6.8 KiB
C
![]() |
//===- ARMTargetTransformInfo.h - ARM specific TTI --------------*- C++ -*-===//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is distributed under the University of Illinois Open Source
|
||
|
// License. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
//
|
||
|
/// \file
|
||
|
/// This file a TargetTransformInfo::Concept conforming object specific to the
|
||
|
/// ARM target machine. It uses the target's detailed information to
|
||
|
/// provide more precise answers to certain TTI queries, while letting the
|
||
|
/// target independent and default TTI implementations handle the rest.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#ifndef LLVM_LIB_TARGET_ARM_ARMTARGETTRANSFORMINFO_H
|
||
|
#define LLVM_LIB_TARGET_ARM_ARMTARGETTRANSFORMINFO_H
|
||
|
|
||
|
#include "ARM.h"
|
||
|
#include "ARMSubtarget.h"
|
||
|
#include "ARMTargetMachine.h"
|
||
|
#include "llvm/ADT/ArrayRef.h"
|
||
|
#include "llvm/Analysis/TargetTransformInfo.h"
|
||
|
#include "llvm/CodeGen/BasicTTIImpl.h"
|
||
|
#include "llvm/IR/Constant.h"
|
||
|
#include "llvm/IR/Function.h"
|
||
|
#include "llvm/MC/SubtargetFeature.h"
|
||
|
|
||
|
namespace llvm {
|
||
|
|
||
|
class APInt;
|
||
|
class ARMTargetLowering;
|
||
|
class Instruction;
|
||
|
class Loop;
|
||
|
class SCEV;
|
||
|
class ScalarEvolution;
|
||
|
class Type;
|
||
|
class Value;
|
||
|
|
||
|
class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
|
||
|
using BaseT = BasicTTIImplBase<ARMTTIImpl>;
|
||
|
using TTI = TargetTransformInfo;
|
||
|
|
||
|
friend BaseT;
|
||
|
|
||
|
const ARMSubtarget *ST;
|
||
|
const ARMTargetLowering *TLI;
|
||
|
|
||
|
// Currently the following features are excluded from InlineFeatureWhitelist.
|
||
|
// ModeThumb, FeatureNoARM, ModeSoftFloat, FeatureVFPOnlySP, FeatureD16
|
||
|
// Depending on whether they are set or unset, different
|
||
|
// instructions/registers are available. For example, inlining a callee with
|
||
|
// -thumb-mode in a caller with +thumb-mode, may cause the assembler to
|
||
|
// fail if the callee uses ARM only instructions, e.g. in inline asm.
|
||
|
const FeatureBitset InlineFeatureWhitelist = {
|
||
|
ARM::FeatureVFP2, ARM::FeatureVFP3, ARM::FeatureNEON, ARM::FeatureThumb2,
|
||
|
ARM::FeatureFP16, ARM::FeatureVFP4, ARM::FeatureFPARMv8,
|
||
|
ARM::FeatureFullFP16, ARM::FeatureHWDivThumb,
|
||
|
ARM::FeatureHWDivARM, ARM::FeatureDB, ARM::FeatureV7Clrex,
|
||
|
ARM::FeatureAcquireRelease, ARM::FeatureSlowFPBrcc,
|
||
|
ARM::FeaturePerfMon, ARM::FeatureTrustZone, ARM::Feature8MSecExt,
|
||
|
ARM::FeatureCrypto, ARM::FeatureCRC, ARM::FeatureRAS,
|
||
|
ARM::FeatureFPAO, ARM::FeatureFuseAES, ARM::FeatureZCZeroing,
|
||
|
ARM::FeatureProfUnpredicate, ARM::FeatureSlowVGETLNi32,
|
||
|
ARM::FeatureSlowVDUP32, ARM::FeaturePreferVMOVSR,
|
||
|
ARM::FeaturePrefISHSTBarrier, ARM::FeatureMuxedUnits,
|
||
|
ARM::FeatureSlowOddRegister, ARM::FeatureSlowLoadDSubreg,
|
||
|
ARM::FeatureDontWidenVMOVS, ARM::FeatureExpandMLx,
|
||
|
ARM::FeatureHasVMLxHazards, ARM::FeatureNEONForFPMovs,
|
||
|
ARM::FeatureNEONForFP, ARM::FeatureCheckVLDnAlign,
|
||
|
ARM::FeatureHasSlowFPVMLx, ARM::FeatureVMLxForwarding,
|
||
|
ARM::FeaturePref32BitThumb, ARM::FeatureAvoidPartialCPSR,
|
||
|
ARM::FeatureCheapPredicableCPSR, ARM::FeatureAvoidMOVsShOp,
|
||
|
ARM::FeatureHasRetAddrStack, ARM::FeatureHasNoBranchPredictor,
|
||
|
ARM::FeatureDSP, ARM::FeatureMP, ARM::FeatureVirtualization,
|
||
|
ARM::FeatureMClass, ARM::FeatureRClass, ARM::FeatureAClass,
|
||
|
ARM::FeatureNaClTrap, ARM::FeatureStrictAlign, ARM::FeatureLongCalls,
|
||
|
ARM::FeatureExecuteOnly, ARM::FeatureReserveR9, ARM::FeatureNoMovt,
|
||
|
ARM::FeatureNoNegativeImmediates
|
||
|
};
|
||
|
|
||
|
const ARMSubtarget *getST() const { return ST; }
|
||
|
const ARMTargetLowering *getTLI() const { return TLI; }
|
||
|
|
||
|
public:
|
||
|
explicit ARMTTIImpl(const ARMBaseTargetMachine *TM, const Function &F)
|
||
|
: BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
|
||
|
TLI(ST->getTargetLowering()) {}
|
||
|
|
||
|
bool areInlineCompatible(const Function *Caller,
|
||
|
const Function *Callee) const;
|
||
|
|
||
|
bool enableInterleavedAccessVectorization() { return true; }
|
||
|
|
||
|
/// Floating-point computation using ARMv8 AArch32 Advanced
|
||
|
/// SIMD instructions remains unchanged from ARMv7. Only AArch64 SIMD
|
||
|
/// is IEEE-754 compliant, but it's not covered in this target.
|
||
|
bool isFPVectorizationPotentiallyUnsafe() {
|
||
|
return !ST->isTargetDarwin();
|
||
|
}
|
||
|
|
||
|
/// \name Scalar TTI Implementations
|
||
|
/// @{
|
||
|
|
||
|
int getIntImmCodeSizeCost(unsigned Opcode, unsigned Idx, const APInt &Imm,
|
||
|
Type *Ty);
|
||
|
|
||
|
using BaseT::getIntImmCost;
|
||
|
int getIntImmCost(const APInt &Imm, Type *Ty);
|
||
|
|
||
|
int getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, Type *Ty);
|
||
|
|
||
|
/// @}
|
||
|
|
||
|
/// \name Vector TTI Implementations
|
||
|
/// @{
|
||
|
|
||
|
unsigned getNumberOfRegisters(bool Vector) {
|
||
|
if (Vector) {
|
||
|
if (ST->hasNEON())
|
||
|
return 16;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
if (ST->isThumb1Only())
|
||
|
return 8;
|
||
|
return 13;
|
||
|
}
|
||
|
|
||
|
unsigned getRegisterBitWidth(bool Vector) const {
|
||
|
if (Vector) {
|
||
|
if (ST->hasNEON())
|
||
|
return 128;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
return 32;
|
||
|
}
|
||
|
|
||
|
unsigned getMaxInterleaveFactor(unsigned VF) {
|
||
|
return ST->getMaxInterleaveFactor();
|
||
|
}
|
||
|
|
||
|
int getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index, Type *SubTp);
|
||
|
|
||
|
int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
|
||
|
const Instruction *I = nullptr);
|
||
|
|
||
|
int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
|
||
|
const Instruction *I = nullptr);
|
||
|
|
||
|
int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index);
|
||
|
|
||
|
int getAddressComputationCost(Type *Val, ScalarEvolution *SE,
|
||
|
const SCEV *Ptr);
|
||
|
|
||
|
int getArithmeticInstrCost(
|
||
|
unsigned Opcode, Type *Ty,
|
||
|
TTI::OperandValueKind Op1Info = TTI::OK_AnyValue,
|
||
|
TTI::OperandValueKind Op2Info = TTI::OK_AnyValue,
|
||
|
TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None,
|
||
|
TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None,
|
||
|
ArrayRef<const Value *> Args = ArrayRef<const Value *>());
|
||
|
|
||
|
int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
|
||
|
unsigned AddressSpace, const Instruction *I = nullptr);
|
||
|
|
||
|
int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor,
|
||
|
ArrayRef<unsigned> Indices, unsigned Alignment,
|
||
|
unsigned AddressSpace);
|
||
|
|
||
|
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
|
||
|
TTI::UnrollingPreferences &UP);
|
||
|
|
||
|
bool shouldBuildLookupTablesForConstant(Constant *C) const {
|
||
|
// In the ROPI and RWPI relocation models we can't have pointers to global
|
||
|
// variables or functions in constant data, so don't convert switches to
|
||
|
// lookup tables if any of the values would need relocation.
|
||
|
if (ST->isROPI() || ST->isRWPI())
|
||
|
return !C->needsRelocation();
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
/// @}
|
||
|
};
|
||
|
|
||
|
} // end namespace llvm
|
||
|
|
||
|
#endif // LLVM_LIB_TARGET_ARM_ARMTARGETTRANSFORMINFO_H
|