LLVM API Documentation
00001 //===-- SystemZSubtarget.h - SystemZ subtarget information -----*- C++ -*--===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file declares the SystemZ specific subclass of TargetSubtargetInfo. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H 00015 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H 00016 00017 #include "SystemZFrameLowering.h" 00018 #include "SystemZISelLowering.h" 00019 #include "SystemZInstrInfo.h" 00020 #include "SystemZRegisterInfo.h" 00021 #include "SystemZSelectionDAGInfo.h" 00022 #include "llvm/IR/DataLayout.h" 00023 #include "llvm/ADT/Triple.h" 00024 #include "llvm/Target/TargetSubtargetInfo.h" 00025 #include <string> 00026 00027 #define GET_SUBTARGETINFO_HEADER 00028 #include "SystemZGenSubtargetInfo.inc" 00029 00030 namespace llvm { 00031 class GlobalValue; 00032 class StringRef; 00033 00034 class SystemZSubtarget : public SystemZGenSubtargetInfo { 00035 virtual void anchor(); 00036 protected: 00037 bool HasDistinctOps; 00038 bool HasLoadStoreOnCond; 00039 bool HasHighWord; 00040 bool HasFPExtension; 00041 bool HasFastSerialization; 00042 bool HasInterlockedAccess1; 00043 00044 private: 00045 Triple TargetTriple; 00046 const DataLayout DL; 00047 SystemZInstrInfo InstrInfo; 00048 SystemZTargetLowering TLInfo; 00049 SystemZSelectionDAGInfo TSInfo; 00050 SystemZFrameLowering FrameLowering; 00051 00052 SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU, 00053 StringRef FS); 00054 public: 00055 SystemZSubtarget(const std::string &TT, const std::string &CPU, 00056 const std::string &FS, const TargetMachine &TM); 00057 00058 const TargetFrameLowering *getFrameLowering() const override { 00059 return &FrameLowering; 00060 } 00061 const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; } 00062 const DataLayout *getDataLayout() const override { return &DL; } 00063 const SystemZRegisterInfo *getRegisterInfo() const override { 00064 return &InstrInfo.getRegisterInfo(); 00065 } 00066 const SystemZTargetLowering *getTargetLowering() const override { 00067 return &TLInfo; 00068 } 00069 const TargetSelectionDAGInfo *getSelectionDAGInfo() const override { 00070 return &TSInfo; 00071 } 00072 00073 // This is important for reducing register pressure in vector code. 00074 bool useAA() const override { return true; } 00075 00076 // Automatically generated by tblgen. 00077 void ParseSubtargetFeatures(StringRef CPU, StringRef FS); 00078 00079 // Return true if the target has the distinct-operands facility. 00080 bool hasDistinctOps() const { return HasDistinctOps; } 00081 00082 // Return true if the target has the load/store-on-condition facility. 00083 bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; } 00084 00085 // Return true if the target has the high-word facility. 00086 bool hasHighWord() const { return HasHighWord; } 00087 00088 // Return true if the target has the floating-point extension facility. 00089 bool hasFPExtension() const { return HasFPExtension; } 00090 00091 // Return true if the target has the fast-serialization facility. 00092 bool hasFastSerialization() const { return HasFastSerialization; } 00093 00094 // Return true if the target has interlocked-access facility 1. 00095 bool hasInterlockedAccess1() const { return HasInterlockedAccess1; } 00096 00097 // Return true if GV can be accessed using LARL for reloc model RM 00098 // and code model CM. 00099 bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM, 00100 CodeModel::Model CM) const; 00101 00102 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); } 00103 }; 00104 } // end namespace llvm 00105 00106 #endif