LLVM  3.7.0
SystemZSubtarget.h
Go to the documentation of this file.
1 //===-- SystemZSubtarget.h - SystemZ subtarget information -----*- C++ -*--===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the SystemZ specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
15 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
16 
17 #include "SystemZFrameLowering.h"
18 #include "SystemZISelLowering.h"
19 #include "SystemZInstrInfo.h"
20 #include "SystemZRegisterInfo.h"
22 #include "llvm/IR/DataLayout.h"
23 #include "llvm/ADT/Triple.h"
25 #include <string>
26 
27 #define GET_SUBTARGETINFO_HEADER
28 #include "SystemZGenSubtargetInfo.inc"
29 
30 namespace llvm {
31 class GlobalValue;
32 class StringRef;
33 
35  virtual void anchor();
36 protected:
47  bool HasVector;
48 
49 private:
50  Triple TargetTriple;
51  SystemZInstrInfo InstrInfo;
52  SystemZTargetLowering TLInfo;
54  SystemZFrameLowering FrameLowering;
55 
56  SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
57  StringRef FS);
58 public:
59  SystemZSubtarget(const Triple &TT, const std::string &CPU,
60  const std::string &FS, const TargetMachine &TM);
61 
62  const TargetFrameLowering *getFrameLowering() const override {
63  return &FrameLowering;
64  }
65  const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
66  const SystemZRegisterInfo *getRegisterInfo() const override {
67  return &InstrInfo.getRegisterInfo();
68  }
69  const SystemZTargetLowering *getTargetLowering() const override {
70  return &TLInfo;
71  }
72  const TargetSelectionDAGInfo *getSelectionDAGInfo() const override {
73  return &TSInfo;
74  }
75 
76  // This is important for reducing register pressure in vector code.
77  bool useAA() const override { return true; }
78 
79  // Automatically generated by tblgen.
81 
82  // Return true if the target has the distinct-operands facility.
83  bool hasDistinctOps() const { return HasDistinctOps; }
84 
85  // Return true if the target has the load/store-on-condition facility.
86  bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
87 
88  // Return true if the target has the high-word facility.
89  bool hasHighWord() const { return HasHighWord; }
90 
91  // Return true if the target has the floating-point extension facility.
92  bool hasFPExtension() const { return HasFPExtension; }
93 
94  // Return true if the target has the population-count facility.
95  bool hasPopulationCount() const { return HasPopulationCount; }
96 
97  // Return true if the target has the fast-serialization facility.
98  bool hasFastSerialization() const { return HasFastSerialization; }
99 
100  // Return true if the target has interlocked-access facility 1.
102 
103  // Return true if the target has the miscellaneous-extensions facility.
106  }
107 
108  // Return true if the target has the transactional-execution facility.
110 
111  // Return true if the target has the processor-assist facility.
112  bool hasProcessorAssist() const { return HasProcessorAssist; }
113 
114  // Return true if the target has the vector facility.
115  bool hasVector() const { return HasVector; }
116 
117  // Return true if GV can be accessed using LARL for reloc model RM
118  // and code model CM.
119  bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM,
120  CodeModel::Model CM) const;
121 
122  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
123 };
124 } // end namespace llvm
125 
126 #endif
bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM, CodeModel::Model CM) const
bool hasInterlockedAccess1() const
bool hasFastSerialization() const
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
const SystemZRegisterInfo & getRegisterInfo() const
bool hasLoadStoreOnCond() const
bool useAA() const override
TargetSelectionDAGInfo - Targets can subclass this to parameterize the SelectionDAG lowering and inst...
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const SystemZInstrInfo * getInstrInfo() const override
bool hasPopulationCount() const
const SystemZTargetLowering * getTargetLowering() const override
const TargetFrameLowering * getFrameLowering() const override
Information about stack frame layout on the target.
bool hasMiscellaneousExtensions() const
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:479
bool hasDistinctOps() const
const TargetSelectionDAGInfo * getSelectionDAGInfo() const override
bool hasProcessorAssist() const
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
bool hasFPExtension() const
bool hasTransactionalExecution() const
const SystemZRegisterInfo * getRegisterInfo() const override
SystemZSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)