aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h')
-rw-r--r--contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h b/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
index c504dd76bc65..07cac776082d 100644
--- a/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
+++ b/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
@@ -9,9 +9,9 @@
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H
+#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "Utils/AMDGPUBaseInfo.h"
namespace llvm {
@@ -29,13 +29,27 @@ protected:
/// Number of bytes in the LDS that are being used.
unsigned LDSSize = 0;
+ /// Number of bytes in the LDS allocated statically. This field is only used
+ /// in the instruction selector and not part of the machine function info.
+ unsigned StaticLDSSize = 0;
+
+ /// Align for dynamic shared memory if any. Dynamic shared memory is
+ /// allocated directly after the static one, i.e., LDSSize. Need to pad
+ /// LDSSize to ensure that dynamic one is aligned accordingly.
+ /// The maximal alignment is updated during IR translation or lowering
+ /// stages.
+ Align DynLDSAlign;
+
// State of MODE register, assumed FP mode.
AMDGPU::SIModeRegisterDefaults Mode;
- // Kernels + shaders. i.e. functions called by the driver and not called
+ // Kernels + shaders. i.e. functions called by the hardware and not called
// by other functions.
bool IsEntryFunction = false;
+ // Entry points called by other functions instead of directly by the hardware.
+ bool IsModuleEntryFunction = false;
+
bool NoSignedZerosFPMath = false;
// Function may be memory bound.
@@ -65,6 +79,8 @@ public:
return IsEntryFunction;
}
+ bool isModuleEntryFunction() const { return IsModuleEntryFunction; }
+
bool hasNoSignedZerosFPMath() const {
return NoSignedZerosFPMath;
}
@@ -78,6 +94,10 @@ public:
}
unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalVariable &GV);
+
+ Align getDynLDSAlign() const { return DynLDSAlign; }
+
+ void setDynLDSAlign(const DataLayout &DL, const GlobalVariable &GV);
};
}