[Beignet] [PATCH v2] GBE: disable custom loop unroll for LLVM 3.3/3.4.
Yang, Rong R
rong.r.yang at intel.com
Sun Oct 19 21:02:09 PDT 2014
Build pass, LGTM, thanks.
-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Zhigang Gong
Sent: Monday, October 20, 2014 09:54
To: beignet at lists.freedesktop.org
Cc: Gong, Zhigang
Subject: [Beignet] [PATCH v2] GBE: disable custom loop unroll for LLVM 3.3/3.4.
To fix a build error with LLVM 3.3/3.4.
v2:
should include llvm-config before check llvm version.
Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
backend/src/llvm/llvm_gen_backend.hpp | 3 +++
backend/src/llvm/llvm_unroll.cpp | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/backend/src/llvm/llvm_gen_backend.hpp b/backend/src/llvm/llvm_gen_backend.hpp
index 35b9a75..a8a5244 100644
--- a/backend/src/llvm/llvm_gen_backend.hpp
+++ b/backend/src/llvm/llvm_gen_backend.hpp
@@ -26,6 +26,7 @@
#ifndef __GBE_LLVM_GEN_BACKEND_HPP__
#define __GBE_LLVM_GEN_BACKEND_HPP__
+#include "llvm/Config/llvm-config.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/LoopPass.h"
#include "sys/platform.hpp"
@@ -102,8 +103,10 @@ namespace gbe
/*! Passer the printf function call. */
llvm::FunctionPass* createPrintfParserPass();
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
/* customized loop unrolling pass. */
llvm::LoopPass *createCustomLoopUnrollPass();
+#endif
/*! Add all the function call of ocl to our bitcode. */
llvm::Module* runBitCodeLinker(llvm::Module *mod, bool strictMath); diff --git a/backend/src/llvm/llvm_unroll.cpp b/backend/src/llvm/llvm_unroll.cpp
index bd0dd8c..271cc7b 100644
--- a/backend/src/llvm/llvm_unroll.cpp
+++ b/backend/src/llvm/llvm_unroll.cpp
@@ -15,8 +15,9 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <set>
#include "llvm/Config/llvm-config.h"
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5 #include <set>
#if LLVM_VERSION_MINOR <= 2
#include "llvm/Function.h"
#include "llvm/InstrTypes.h"
@@ -224,3 +225,4 @@ namespace gbe {
return new CustomLoopUnroll();
}
} // end namespace
+#endif
--
1.8.3.2
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list