Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
Line
Count
Source
1
//===-- AMDGPUMachineFunctionInfo.h -------------------------------*- C++ -*-=//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
10
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
11
12
#include "llvm/ADT/DenseMap.h"
13
#include "llvm/CodeGen/MachineFunction.h"
14
15
namespace llvm {
16
17
class GCNSubtarget;
18
19
class AMDGPUMachineFunction : public MachineFunctionInfo {
20
  /// A map to keep track of local memory objects and their offsets within the
21
  /// local memory space.
22
  SmallDenseMap<const GlobalValue *, unsigned, 4> LocalMemoryObjects;
23
24
protected:
25
  uint64_t ExplicitKernArgSize; // Cache for this.
26
  unsigned MaxKernArgAlign; // Cache for this.
27
28
  /// Number of bytes in the LDS that are being used.
29
  unsigned LDSSize;
30
31
  // Kernels + shaders. i.e. functions called by the driver and not called
32
  // by other functions.
33
  bool IsEntryFunction;
34
35
  bool NoSignedZerosFPMath;
36
37
  // Function may be memory bound.
38
  bool MemoryBound;
39
40
  // Kernel may need limited waves per EU for better performance.
41
  bool WaveLimiter;
42
43
public:
44
  AMDGPUMachineFunction(const MachineFunction &MF);
45
46
5.86k
  uint64_t getExplicitKernArgSize() const {
47
5.86k
    return ExplicitKernArgSize;
48
5.86k
  }
49
50
5.80k
  unsigned getMaxKernArgAlign() const {
51
5.80k
    return MaxKernArgAlign;
52
5.80k
  }
53
54
351k
  unsigned getLDSSize() const {
55
351k
    return LDSSize;
56
351k
  }
57
58
543k
  bool isEntryFunction() const {
59
543k
    return IsEntryFunction;
60
543k
  }
61
62
56.3k
  bool hasNoSignedZerosFPMath() const {
63
56.3k
    return NoSignedZerosFPMath;
64
56.3k
  }
65
66
39.3k
  bool isMemoryBound() const {
67
39.3k
    return MemoryBound;
68
39.3k
  }
69
70
36.4k
  bool needsWaveLimiter() const {
71
36.4k
    return WaveLimiter;
72
36.4k
  }
73
74
  unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalValue &GV);
75
};
76
77
}
78
#endif