Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- SystemZSubtarget.cpp - SystemZ subtarget information --------------===//
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
#include "SystemZSubtarget.h"
11
#include "MCTargetDesc/SystemZMCTargetDesc.h"
12
#include "llvm/IR/GlobalValue.h"
13
14
using namespace llvm;
15
16
#define DEBUG_TYPE "systemz-subtarget"
17
18
#define GET_SUBTARGETINFO_TARGET_DESC
19
#define GET_SUBTARGETINFO_CTOR
20
#include "SystemZGenSubtargetInfo.inc"
21
22
// Pin the vtable to this file.
23
0
void SystemZSubtarget::anchor() {}
24
25
SystemZSubtarget &
26
857
SystemZSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) {
27
857
  std::string CPUName = CPU;
28
857
  if (CPUName.empty())
29
422
    CPUName = "generic";
30
857
  // Parse features string.
31
857
  ParseSubtargetFeatures(CPUName, FS);
32
857
  return *this;
33
857
}
34
35
SystemZSubtarget::SystemZSubtarget(const Triple &TT, const std::string &CPU,
36
                                   const std::string &FS,
37
                                   const TargetMachine &TM)
38
    : SystemZGenSubtargetInfo(TT, CPU, FS), HasDistinctOps(false),
39
      HasLoadStoreOnCond(false), HasHighWord(false), HasFPExtension(false),
40
      HasPopulationCount(false), HasMessageSecurityAssist3(false),
41
      HasMessageSecurityAssist4(false), HasResetReferenceBitsMultiple(false),
42
      HasFastSerialization(false), HasInterlockedAccess1(false),
43
      HasMiscellaneousExtensions(false),
44
      HasExecutionHint(false), HasLoadAndTrap(false),
45
      HasTransactionalExecution(false), HasProcessorAssist(false),
46
      HasDFPZonedConversion(false), HasEnhancedDAT2(false),
47
      HasVector(false), HasLoadStoreOnCond2(false),
48
      HasLoadAndZeroRightmostByte(false), HasMessageSecurityAssist5(false),
49
      HasDFPPackedConversion(false),
50
      HasMiscellaneousExtensions2(false), HasGuardedStorage(false),
51
      HasMessageSecurityAssist7(false), HasMessageSecurityAssist8(false),
52
      HasVectorEnhancements1(false), HasVectorPackedDecimal(false),
53
      HasInsertReferenceBitsMultiple(false),
54
      TargetTriple(TT), InstrInfo(initializeSubtargetDependencies(CPU, FS)),
55
857
      TLInfo(TM, *this), TSInfo(), FrameLowering() {}
56
57
bool SystemZSubtarget::isPC32DBLSymbol(const GlobalValue *GV,
58
350
                                       CodeModel::Model CM) const {
59
350
  // PC32DBL accesses require the low bit to be clear.  Note that a zero
60
350
  // value selects the default alignment and is therefore OK.
61
350
  if (GV->getAlignment() == 1)
62
12
    return false;
63
338
64
338
  // For the small model, all locally-binding symbols are in range.
65
338
  
if (338
CM == CodeModel::Small338
)
66
322
    return TLInfo.getTargetMachine().shouldAssumeDSOLocal(*GV->getParent(), GV);
67
16
68
16
  // For Medium and above, assume that the symbol is not within the 4GB range.
69
16
  // Taking the address of locally-defined text would be OK, but that
70
16
  // case isn't easy to detect.
71
16
  return false;
72
16
}