summaryrefslogtreecommitdiff
path: root/backend/src/ir
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2014-06-10 12:52:54 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-06-11 11:04:04 +0800
commit42cdacda1b5217c593d23621775651a7143a353c (patch)
tree20e60920e80d69c9424a0b449df6c7f2f1450763 /backend/src/ir
parent91afb05c0f6440ada79a0e6896b64aa0bc3b2ca2 (diff)
Add the PrintfParser llvm parser into the llvm backend.
The PrintfParser will work before the llvm gen backend. It will filter out all the printf function call. When the printf call found, we will analyse the print format and % place holder here. Replace the print call with STORE or CONV+STORE instruction if needed. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'backend/src/ir')
-rw-r--r--backend/src/ir/function.cpp1
-rw-r--r--backend/src/ir/function.hpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/backend/src/ir/function.cpp b/backend/src/ir/function.cpp
index b0df412d..a46108ea 100644
--- a/backend/src/ir/function.cpp
+++ b/backend/src/ir/function.cpp
@@ -48,6 +48,7 @@ namespace ir {
initProfile(*this);
samplerSet = GBE_NEW(SamplerSet);
imageSet = GBE_NEW(ImageSet);
+ printfSet = GBE_NEW(PrintfSet);
}
Function::~Function(void) {
diff --git a/backend/src/ir/function.hpp b/backend/src/ir/function.hpp
index 266e6526..63bb6ea5 100644
--- a/backend/src/ir/function.hpp
+++ b/backend/src/ir/function.hpp
@@ -29,6 +29,7 @@
#include "ir/instruction.hpp"
#include "ir/profile.hpp"
#include "ir/sampler.hpp"
+#include "ir/printf.hpp"
#include "ir/image.hpp"
#include "sys/vector.hpp"
#include "sys/set.hpp"
@@ -329,6 +330,8 @@ namespace ir {
SamplerSet* getSamplerSet(void) const {return samplerSet; }
/*! Get image set in this function */
ImageSet* getImageSet(void) const {return imageSet; }
+ /*! Get printf set in this function */
+ PrintfSet* getPrintfSet(void) const {return printfSet; }
/*! Set required work group size. */
void setCompileWorkGroupSize(size_t x, size_t y, size_t z) { compileWgSize[0] = x; compileWgSize[1] = y; compileWgSize[2] = z; }
/*! Get required work group size. */
@@ -360,6 +363,7 @@ namespace ir {
uint32_t stackSize; //!< stack size for private memory.
SamplerSet *samplerSet; //!< samplers used in this function.
ImageSet* imageSet; //!< Image set in this function's arguments..
+ PrintfSet *printfSet; //!< printfSet store the printf info.
size_t compileWgSize[3]; //!< required work group size specified by
// __attribute__((reqd_work_group_size(X, Y, Z))).
GBE_CLASS(Function); //!< Use custom allocator