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/Support/TargetRegistry.h"
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "SystemZGenSubtargetInfo.inc"
26 SystemZSubtarget::SystemZSubtarget(const std::string &TT,
27 const std::string &CPU,
28 const std::string &FS):
29 SystemZGenSubtargetInfo(TT, CPU, FS), HasZ10Insts(false) {
30 std::string CPUName = CPU;
34 // Parse features string.
35 ParseSubtargetFeatures(CPUName, FS);
38 /// True if accessing the GV requires an extra load.
39 bool SystemZSubtarget::GVRequiresExtraLoad(const GlobalValue* GV,
40 const TargetMachine& TM,
41 bool isDirectCall) const {
42 if (TM.getRelocationModel() == Reloc::PIC_) {
43 // Extra load is needed for all externally visible.
47 if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())