LLVM API Documentation

SystemZSubtarget.cpp

Go to the documentation of this file.
00001 //===- SystemZSubtarget.cpp - 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 implements the SystemZ specific subclass of TargetSubtarget.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "SystemZSubtarget.h"
00015 #include "SystemZ.h"
00016 #include "SystemZGenSubtarget.inc"
00017 #include "llvm/GlobalValue.h"
00018 #include "llvm/Target/TargetMachine.h"
00019 
00020 using namespace llvm;
00021 
00022 SystemZSubtarget::SystemZSubtarget(const std::string &TT, 
00023                                    const std::string &FS):
00024   HasZ10Insts(false) {
00025   std::string CPU = "z9";
00026 
00027   // Parse features string.
00028   ParseSubtargetFeatures(FS, CPU);
00029 }
00030 
00031 /// True if accessing the GV requires an extra load.
00032 bool SystemZSubtarget::GVRequiresExtraLoad(const GlobalValue* GV,
00033                                            const TargetMachine& TM,
00034                                            bool isDirectCall) const {
00035   if (TM.getRelocationModel() == Reloc::PIC_) {
00036     // Extra load is needed for all externally visible.
00037     if (isDirectCall)
00038       return false;
00039 
00040     if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
00041       return false;
00042 
00043     return true;
00044   }
00045 
00046   return false;
00047 }