2016-03-11 16:00:27 +08:00
|
|
|
//===-- AMDGPUMachineFunctionInfo.h -------------------------------*- C++ -*-=//
|
2013-04-02 05:47:53 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-04-02 05:47:53 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-03-11 16:00:27 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
|
|
|
|
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
|
2013-04-02 05:47:53 +08:00
|
|
|
|
2016-07-27 00:45:58 +08:00
|
|
|
#include "llvm/ADT/DenseMap.h"
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
2013-04-02 05:47:53 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2018-07-12 04:59:01 +08:00
|
|
|
class GCNSubtarget;
|
2018-06-28 18:18:55 +08:00
|
|
|
|
2013-04-02 05:47:53 +08:00
|
|
|
class AMDGPUMachineFunction : public MachineFunctionInfo {
|
2016-07-27 00:45:58 +08:00
|
|
|
/// A map to keep track of local memory objects and their offsets within the
|
|
|
|
/// local memory space.
|
|
|
|
SmallDenseMap<const GlobalValue *, unsigned, 4> LocalMemoryObjects;
|
|
|
|
|
2018-05-30 03:35:00 +08:00
|
|
|
protected:
|
2018-07-20 17:05:08 +08:00
|
|
|
uint64_t ExplicitKernArgSize; // Cache for this.
|
|
|
|
unsigned MaxKernArgAlign; // Cache for this.
|
2016-06-18 13:15:53 +08:00
|
|
|
|
2016-07-27 00:45:58 +08:00
|
|
|
/// Number of bytes in the LDS that are being used.
|
|
|
|
unsigned LDSSize;
|
|
|
|
|
2018-04-14 16:59:00 +08:00
|
|
|
// Kernels + shaders. i.e. functions called by the driver and not called
|
2017-03-31 07:58:04 +08:00
|
|
|
// by other functions.
|
|
|
|
bool IsEntryFunction;
|
|
|
|
|
2017-02-28 03:35:42 +08:00
|
|
|
bool NoSignedZerosFPMath;
|
2014-07-13 11:06:39 +08:00
|
|
|
|
2018-05-26 01:25:12 +08:00
|
|
|
// Function may be memory bound.
|
|
|
|
bool MemoryBound;
|
|
|
|
|
|
|
|
// Kernel may need limited waves per EU for better performance.
|
|
|
|
bool WaveLimiter;
|
|
|
|
|
2013-04-02 05:47:53 +08:00
|
|
|
public:
|
|
|
|
AMDGPUMachineFunction(const MachineFunction &MF);
|
2016-06-18 13:15:53 +08:00
|
|
|
|
2018-06-28 18:18:55 +08:00
|
|
|
uint64_t getExplicitKernArgSize() const {
|
|
|
|
return ExplicitKernArgSize;
|
2016-07-27 00:45:58 +08:00
|
|
|
}
|
2014-07-13 11:06:39 +08:00
|
|
|
|
2016-12-07 05:53:10 +08:00
|
|
|
unsigned getMaxKernArgAlign() const {
|
|
|
|
return MaxKernArgAlign;
|
|
|
|
}
|
|
|
|
|
2016-07-27 00:45:58 +08:00
|
|
|
unsigned getLDSSize() const {
|
|
|
|
return LDSSize;
|
|
|
|
}
|
2015-11-06 19:45:14 +08:00
|
|
|
|
2017-03-31 07:58:04 +08:00
|
|
|
bool isEntryFunction() const {
|
|
|
|
return IsEntryFunction;
|
2016-07-27 00:45:58 +08:00
|
|
|
}
|
|
|
|
|
2017-02-28 03:35:42 +08:00
|
|
|
bool hasNoSignedZerosFPMath() const {
|
|
|
|
return NoSignedZerosFPMath;
|
|
|
|
}
|
|
|
|
|
2018-05-26 01:25:12 +08:00
|
|
|
bool isMemoryBound() const {
|
|
|
|
return MemoryBound;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool needsWaveLimiter() const {
|
|
|
|
return WaveLimiter;
|
|
|
|
}
|
|
|
|
|
2016-07-27 00:45:58 +08:00
|
|
|
unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalValue &GV);
|
2013-04-02 05:47:53 +08:00
|
|
|
};
|
|
|
|
|
2015-06-23 17:49:53 +08:00
|
|
|
}
|
2014-08-14 00:26:38 +08:00
|
|
|
#endif
|