1 //===- SystemZSubtarget.cpp - SystemZ Subtarget Information -------*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the SystemZ specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #include "SystemZSubtarget.h"
16 #include "llvm/GlobalValue.h"
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetRegistry.h"
20 #define GET_SUBTARGETINFO_ENUM
21 #define GET_SUBTARGETINFO_MC_DESC
22 #define GET_SUBTARGETINFO_TARGET_DESC
23 #define GET_SUBTARGETINFO_CTOR
24 #include "SystemZGenSubtargetInfo.inc"
28 SystemZSubtarget::SystemZSubtarget(const std::string
&TT
,
29 const std::string
&CPU
,
30 const std::string
&FS
):
31 SystemZGenSubtargetInfo(TT
, CPU
, FS
), HasZ10Insts(false) {
32 std::string CPUName
= CPU
;
36 // Parse features string.
37 ParseSubtargetFeatures(CPUName
, FS
);
40 /// True if accessing the GV requires an extra load.
41 bool SystemZSubtarget::GVRequiresExtraLoad(const GlobalValue
* GV
,
42 const TargetMachine
& TM
,
43 bool isDirectCall
) const {
44 if (TM
.getRelocationModel() == Reloc::PIC_
) {
45 // Extra load is needed for all externally visible.
49 if (GV
->hasLocalLinkage() || GV
->hasHiddenVisibility())
58 MCSubtargetInfo
*createSystemZMCSubtargetInfo(StringRef TT
, StringRef CPU
,
60 MCSubtargetInfo
*X
= new MCSubtargetInfo();
61 InitSystemZMCSubtargetInfo(X
, CPU
, FS
);
65 extern "C" void LLVMInitializeSystemZMCSubtargetInfo() {
66 TargetRegistry::RegisterMCSubtargetInfo(TheSystemZTarget
,
67 createSystemZMCSubtargetInfo
);