Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/Sparc/SparcSubtarget.h
Line
Count
Source (jump to first uncovered line)
1
//===-- SparcSubtarget.h - Define Subtarget for the SPARC -------*- C++ -*-===//
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
// This file declares the SPARC specific subclass of TargetSubtargetInfo.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_LIB_TARGET_SPARC_SPARCSUBTARGET_H
15
#define LLVM_LIB_TARGET_SPARC_SPARCSUBTARGET_H
16
17
#include "SparcFrameLowering.h"
18
#include "SparcISelLowering.h"
19
#include "SparcInstrInfo.h"
20
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
21
#include "llvm/IR/DataLayout.h"
22
#include "llvm/Target/TargetFrameLowering.h"
23
#include "llvm/Target/TargetSubtargetInfo.h"
24
#include <string>
25
26
#define GET_SUBTARGETINFO_HEADER
27
#include "SparcGenSubtargetInfo.inc"
28
29
namespace llvm {
30
class StringRef;
31
32
class SparcSubtarget : public SparcGenSubtargetInfo {
33
  Triple TargetTriple;
34
  virtual void anchor();
35
  bool UseSoftMulDiv;
36
  bool IsV9;
37
  bool IsLeon;
38
  bool V8DeprecatedInsts;
39
  bool IsVIS, IsVIS2, IsVIS3;
40
  bool Is64Bit;
41
  bool HasHardQuad;
42
  bool UsePopc;
43
  bool UseSoftFloat;
44
  bool HasNoFSMULD;
45
  bool HasNoFMULS;
46
47
  // LEON features
48
  bool HasUmacSmac;
49
  bool HasLeonCasa;
50
  bool InsertNOPLoad;
51
  bool FixAllFDIVSQRT;
52
  bool DetectRoundChange;
53
  bool PerformSDIVReplace;
54
55
  SparcInstrInfo InstrInfo;
56
  SparcTargetLowering TLInfo;
57
  SelectionDAGTargetInfo TSInfo;
58
  SparcFrameLowering FrameLowering;
59
60
public:
61
  SparcSubtarget(const Triple &TT, const std::string &CPU,
62
                 const std::string &FS, const TargetMachine &TM, bool is64bit);
63
64
45.4k
  const SparcInstrInfo *getInstrInfo() const override { return &InstrInfo; }
65
12.5k
  const TargetFrameLowering *getFrameLowering() const override {
66
12.5k
    return &FrameLowering;
67
12.5k
  }
68
105k
  const SparcRegisterInfo *getRegisterInfo() const override {
69
105k
    return &InstrInfo.getRegisterInfo();
70
105k
  }
71
20.6k
  const SparcTargetLowering *getTargetLowering() const override {
72
20.6k
    return &TLInfo;
73
20.6k
  }
74
645
  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
75
645
    return &TSInfo;
76
645
  }
77
78
  bool enableMachineScheduler() const override;
79
80
376
  bool useSoftMulDiv() const { return UseSoftMulDiv; }
81
14.4k
  bool isV9() const { return IsV9; }
82
0
  bool isLeon() const { return IsLeon; }
83
0
  bool isVIS() const { return IsVIS; }
84
0
  bool isVIS2() const { return IsVIS2; }
85
0
  bool isVIS3() const { return IsVIS3; }
86
0
  bool useDeprecatedV8Instructions() const { return V8DeprecatedInsts; }
87
1.69k
  bool hasHardQuad() const { return HasHardQuad; }
88
495
  bool usePopc() const { return UsePopc; }
89
843
  bool useSoftFloat() const { return UseSoftFloat; }
90
6
  bool hasNoFSMULD() const { return HasNoFSMULD; }
91
384
  bool hasNoFMULS() const { return HasNoFMULS; }
92
93
  // Leon options
94
0
  bool hasUmacSmac() const { return HasUmacSmac; }
95
8
  bool performSDIVReplace() const { return PerformSDIVReplace; }
96
238
  bool hasLeonCasa() const { return HasLeonCasa; }
97
713
  bool insertNOPLoad() const { return InsertNOPLoad; }
98
1.08k
  bool fixAllFDIVSQRT() const { return FixAllFDIVSQRT; }
99
175
  bool detectRoundChange() const { return DetectRoundChange; }
100
101
  /// ParseSubtargetFeatures - Parses features string setting specified
102
  /// subtarget options.  Definition of function is auto generated by tblgen.
103
  void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
104
  SparcSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
105
106
17.0k
  bool is64Bit() const { return Is64Bit; }
107
108
  /// The 64-bit ABI uses biased stack and frame pointers, so the stack frame
109
  /// of the current function is the area from [%sp+BIAS] to [%fp+BIAS].
110
1.52k
  int64_t getStackPointerBias() const {
111
1.52k
    return is64Bit() ? 
2047210
:
01.31k
;
112
1.52k
  }
113
114
  /// Given a actual stack size as determined by FrameInfo, this function
115
  /// returns adjusted framesize which includes space for register window
116
  /// spills and arguments.
117
  int getAdjustedFrameSize(int stackSize) const;
118
119
16
  bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
120
};
121
122
} // end namespace llvm
123
124
#endif