LLVM  14.0.0git
ARMTargetMachine.h
Go to the documentation of this file.
1 //===-- ARMTargetMachine.h - Define TargetMachine for ARM -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the ARM specific subclass of TargetMachine.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
15 
16 #include "ARMSubtarget.h"
17 #include "llvm/ADT/Optional.h"
18 #include "llvm/ADT/StringMap.h"
19 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Support/CodeGen.h"
23 #include <memory>
24 
25 namespace llvm {
26 
28 public:
29  enum ARMABI {
32  ARM_ABI_AAPCS, // ARM EABI
34  } TargetABI;
35 
36 protected:
37  std::unique_ptr<TargetLoweringObjectFile> TLOF;
38  bool isLittle;
40 
41 public:
42  ARMBaseTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
45  CodeGenOpt::Level OL, bool isLittle);
46  ~ARMBaseTargetMachine() override;
47 
48  const ARMSubtarget *getSubtargetImpl(const Function &F) const override;
49  // DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,
50  // subtargets are per-function entities based on the target-specific
51  // attributes of each function.
52  const ARMSubtarget *getSubtargetImpl() const = delete;
53  bool isLittleEndian() const { return isLittle; }
54 
56 
57  // Pass Pipeline Configuration
59 
61  return TLOF.get();
62  }
63 
64  bool isTargetHardFloat() const {
72  }
73 
74  bool targetSchedulesPostRAScheduling() const override { return true; };
75 
76  /// Returns true if a cast between SrcAS and DestAS is a noop.
77  bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override {
78  // Addrspacecasts are always noops.
79  return true;
80  }
81 };
82 
83 /// ARM/Thumb little endian target machine.
84 ///
86 public:
87  ARMLETargetMachine(const Target &T, const Triple &TT, StringRef CPU,
90  CodeGenOpt::Level OL, bool JIT);
91 };
92 
93 /// ARM/Thumb big endian target machine.
94 ///
96 public:
97  ARMBETargetMachine(const Target &T, const Triple &TT, StringRef CPU,
100  CodeGenOpt::Level OL, bool JIT);
101 };
102 
103 } // end namespace llvm
104 
105 #endif // LLVM_LIB_TARGET_ARM_ARMTARGETMACHINE_H
ARMSubtarget.h
llvm::ARMBaseTargetMachine::ARM_ABI_APCS
@ ARM_ABI_APCS
Definition: ARMTargetMachine.h:31
llvm::ARMBaseTargetMachine
Definition: ARMTargetMachine.h:27
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
Optional.h
llvm::TargetOptions
Definition: TargetOptions.h:124
llvm::ARMSubtarget
Definition: ARMSubtarget.h:46
llvm::Function
Definition: Function.h:62
StringRef.h
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::ARMBaseTargetMachine::ARM_ABI_AAPCS
@ ARM_ABI_AAPCS
Definition: ARMTargetMachine.h:32
llvm::TargetTransformInfo
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Definition: TargetTransformInfo.h:168
llvm::Triple::MuslEABIHF
@ MuslEABIHF
Definition: Triple.h:223
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::TargetMachine::RM
Reloc::Model RM
Definition: TargetMachine.h:102
llvm::Optional< Reloc::Model >
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::ARMBaseTargetMachine::ARM_ABI_AAPCS16
@ ARM_ABI_AAPCS16
Definition: ARMTargetMachine.h:33
llvm::ARMBETargetMachine::ARMBETargetMachine
ARMBETargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
Definition: ARMTargetMachine.cpp:320
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::ARMBaseTargetMachine::getSubtargetImpl
const ARMSubtarget * getSubtargetImpl() const =delete
llvm::TargetLoweringObjectFile
Definition: TargetLoweringObjectFile.h:44
llvm::ARMBaseTargetMachine::~ARMBaseTargetMachine
~ARMBaseTargetMachine() override
TargetMachine.h
llvm::ARMBaseTargetMachine::isTargetHardFloat
bool isTargetHardFloat() const
Definition: ARMTargetMachine.h:64
llvm::ARMBaseTargetMachine::isLittleEndian
bool isLittleEndian() const
Definition: ARMTargetMachine.h:53
llvm::Triple::isOSBinFormatMachO
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition: Triple.h:646
StringMap.h
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:108
llvm::TargetPassConfig
Target-Independent Code Generator Pass Configuration Options.
Definition: TargetPassConfig.h:84
llvm::TargetMachine::TargetTriple
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
Definition: TargetMachine.h:98
llvm::EngineKind::JIT
@ JIT
Definition: ExecutionEngine.h:524
llvm::ARMBaseTargetMachine::targetSchedulesPostRAScheduling
bool targetSchedulesPostRAScheduling() const override
True if subtarget inserts the final scheduling pass on its own.
Definition: ARMTargetMachine.h:74
llvm::TargetMachine::Options
TargetOptions Options
Definition: TargetMachine.h:120
llvm::ARMBaseTargetMachine::isNoopAddrSpaceCast
bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override
Returns true if a cast between SrcAS and DestAS is a noop.
Definition: ARMTargetMachine.h:77
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::Triple::isOSWindows
bool isOSWindows() const
Tests whether the OS is Windows.
Definition: Triple.h:548
llvm::ARMBaseTargetMachine::getObjFileLowering
TargetLoweringObjectFile * getObjFileLowering() const override
Definition: ARMTargetMachine.h:60
llvm::ARMBaseTargetMachine::ARMBaseTargetMachine
ARMBaseTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool isLittle)
Create an ARM architecture model.
Definition: ARMTargetMachine.cpp:212
llvm::Triple::getSubArch
SubArchType getSubArch() const
get the parsed subarchitecture type for this triple.
Definition: Triple.h:313
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::Triple::ARMSubArch_v7em
@ ARMSubArch_v7em
Definition: Triple.h:125
llvm::LLVMTargetMachine
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Definition: TargetMachine.h:393
llvm::ARMBaseTargetMachine::ARMABI
ARMABI
Definition: ARMTargetMachine.h:29
llvm::ARMBaseTargetMachine::TargetABI
enum llvm::ARMBaseTargetMachine::ARMABI TargetABI
CodeGen.h
llvm::ARMLETargetMachine::ARMLETargetMachine
ARMLETargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OL, bool JIT)
Definition: ARMTargetMachine.cpp:312
llvm::ARMBaseTargetMachine::TLOF
std::unique_ptr< TargetLoweringObjectFile > TLOF
Definition: ARMTargetMachine.h:37
llvm::ARMBaseTargetMachine::ARM_ABI_UNKNOWN
@ ARM_ABI_UNKNOWN
Definition: ARMTargetMachine.h:30
llvm::ARMLETargetMachine
ARM/Thumb little endian target machine.
Definition: ARMTargetMachine.h:85
llvm::ARMBaseTargetMachine::SubtargetMap
StringMap< std::unique_ptr< ARMSubtarget > > SubtargetMap
Definition: ARMTargetMachine.h:39
TargetTransformInfo.h
llvm::legacy::PassManagerBase
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Definition: LegacyPassManager.h:39
llvm::ARMBETargetMachine
ARM/Thumb big endian target machine.
Definition: ARMTargetMachine.h:95
llvm::Triple::getEnvironment
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
Definition: Triple.h:327
llvm::Triple::EABIHF
@ EABIHF
Definition: Triple.h:219
llvm::ARMBaseTargetMachine::isLittle
bool isLittle
Definition: ARMTargetMachine.h:38
llvm::Triple::GNUEABIHF
@ GNUEABIHF
Definition: Triple.h:214
llvm::ARMBaseTargetMachine::getTargetTransformInfo
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
Definition: ARMTargetMachine.cpp:308
llvm::ARMBaseTargetMachine::createPassConfig
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
Definition: ARMTargetMachine.cpp:394