P4 to Git Change 1076493 by yaxunl@yaxunl_stg_win50 on 2014/09/12 14:45:24

ECR #377625 - AMDIL Function support: Calculate total private memory usage by a kernel including memory used by called functions.

	This cannot be done by IPA since stack size is known only after register allocation due to potential register spill, but MachineFunctionAnalysis cannot persist after CGSCC pass with current LLVM version.

	This change adds private memory usage metadata for non-kernel functions. The total private memory usage by a kernel is calculated when AMDIL is split for different kernels. BIF will contain total private memory size.

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/amdilUtils.cpp#1 add
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/amdilUtils.hpp#1 add
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/AMDILKernelManager.cpp#451 edit
... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/Target/AMDIL/AMDILKernelManager.h#51 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#175 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.hpp#54 edit
This commit is contained in:
foreman
2014-09-12 15:02:32 -04:00
parent fea6100aa9
commit 42f4b2af97
4 changed files with 53 additions and 4 deletions
+6 -2
View File
@@ -50,6 +50,7 @@ public:
, hwPrivateSize_(0)
, hwLocalSize_(0)
, flags_(0)
, totalHwPrivateSize_(-1)
{
code_.begin_ = code_.end_ = 0;
metadata_.begin_ = metadata_.end_ = 0;
@@ -74,6 +75,7 @@ public:
hwPrivateSize_ = func.hwPrivateSize_;
hwLocalSize_ = func.hwLocalSize_;
flags_ = func.flags_;
totalHwPrivateSize_ = func.totalHwPrivateSize_;
// Note: we don't copy calls_ and macros_
return *this;
@@ -89,9 +91,11 @@ public:
uint hwPrivateSize_; //!< HW private ring allocation by the function
uint hwLocalSize_; //!< HW local ring allocation by the function
uint flags_; //!< The IL func flags/properties
std::vector<const ILFunc*> calls_; //! Functions called from the current
long long totalHwPrivateSize_; //!< total HW private usage including called functions
std::vector<ILFunc*> calls_; //! Functions called from the current
std::vector<uint> macros_; //! Macros, used in the IL function
uint totalHwPrivateUsage(); //!< total HW private usage including called functions
};
//! \class empty program