[Beignet] [PATCH 04/19] GBE: remove image type's access qual from image type name.
Yang Rong
rong.r.yang at intel.com
Mon Nov 28 11:32:30 UTC 2016
OpenCL spec require type name don't include access qual, so remove it.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
backend/src/llvm/llvm_gen_backend.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp
index dea031b..17eaec6 100644
--- a/backend/src/llvm/llvm_gen_backend.cpp
+++ b/backend/src/llvm/llvm_gen_backend.cpp
@@ -2351,6 +2351,14 @@ namespace gbe
}
if(typeNameNode) {
llvmInfo.typeName = (cast<MDString>(typeNameNode->getOperand(opID)))->getString();
+ //LLVM 3.9 image's type name include access qual, don't match OpenCL spec, erase them.
+ std::vector<std::string> filters = {"__read_only ", "__write_only "};
+ for (uint32_t i = 0; i < filters.size(); i++) {
+ size_t pos = llvmInfo.typeName.find(filters[i]);
+ if (pos != std::string::npos) {
+ llvmInfo.typeName = llvmInfo.typeName.erase(pos, filters[i].length());
+ }
+ }
}
if(typeBaseNameNode){
llvmInfo.typeBaseName = (cast<MDString>(typeBaseNameNode->getOperand(opID)))->getString();
--
2.1.4
More information about the Beignet
mailing list