igc: build for native too

* Use clang and lld for native builds to remain in sync with clang layer.

* fix the license field to point to correct block of license in source
file.

* Include patches to ignore warnings being marked as errors when building
with clang and to fix an issue with inclusion of debug functions when
NDEBUG is defined.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
Anuj Mittal 2019-08-15 08:21:03 +08:00
parent 9804b5a0e9
commit fca3176ec1
3 changed files with 130 additions and 3 deletions

View File

@ -0,0 +1,86 @@
From f56b781c244347158467a01aef65d2787afd1366 Mon Sep 17 00:00:00 2001
From: Anuj Mittal <anuj.mittal@intel.com>
Date: Sat, 17 Aug 2019 21:25:06 +0800
Subject: [PATCH] comment out dump functions
Otherwise it leads to errors when linking with lld:
| ld.lld: error: undefined symbol: llvm::Value::dump() const
| >>> referenced by PreRAScheduler.cpp:252 (build/tmp/work/x86_64-linux/intel-graphics-compiler-native/1.0.10-r0/git/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp:252)
| >>> PreRAScheduler.cpp.o:(IGC::PreRAScheduler::dumpDDGContents()) in archive IGC/Release/libCompiler.a
|
| ld.lld: error: undefined symbol: llvm::Value::dump() const
| >>> referenced by PreRAScheduler.cpp:855 (build/tmp/work/x86_64-linux/intel-graphics-compiler-native/1.0.10-r0/git/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp:855)
| >>> PreRAScheduler.cpp.o:(IGC::PreRAScheduler::dumpPriorityQueueContents()) in archive IGC/Release/libCompiler.a
|
| ld.lld: error: undefined symbol: llvm::Value::dump() const
| >>> referenced by PreRAScheduler.cpp:876 (build/tmp/work/x86_64-linux/intel-graphics-compiler-native/1.0.10-r0/git/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp:876)
| >>> PreRAScheduler.cpp.o:(IGC::PreRAScheduler::dumpPriorityQueueContents()) in archive IGC/Release/libCompiler.a
|
| ld.lld: error: undefined symbol: llvm::Value::dump() const
| >>> referenced by PreRAScheduler.cpp:888 (build/tmp/work/x86_64-linux/intel-graphics-compiler-native/1.0.10-r0/git/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp:888)
| >>> PreRAScheduler.cpp.o:(IGC::PreRAScheduler::dumpPriorityQueueContents()) in archive IGC/Release/libCompiler.a
|
| ld.lld: error: undefined symbol: llvm::Value::dump() const
| >>> referenced by PreRAScheduler.cpp:902 (build/tmp/work/x86_64-linux/intel-graphics-compiler-native/1.0.10-r0/git/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp:902)
| >>> PreRAScheduler.cpp.o:(IGC::PreRAScheduler::dumpPriorityQueueContents()) in archive IGC/Release/libCompiler.a
| clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
| ninja: build stopped: subcommand failed.
Upstream-Status: Submitted [https://github.com/intel/intel-graphics-compiler/pull/105]
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
IGC/Compiler/CISACodeGen/PreRAScheduler.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp b/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp
index 587e491..4effa80 100644
--- a/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp
+++ b/IGC/Compiler/CISACodeGen/PreRAScheduler.cpp
@@ -178,8 +178,10 @@ namespace IGC{
AU.addRequired<RegisterEstimator>();
}
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dumpDDGContents();
void dumpPriorityQueueContents();
+#endif
void clearDDG();
@@ -228,6 +230,7 @@ IGC_INITIALIZE_PASS_DEPENDENCY(RegisterEstimator)
IGC_INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
IGC_INITIALIZE_PASS_END(PreRAScheduler, PASS_FLAG, PASS_DESC, PASS_CFG_ONLY, PASS_ANALYSIS)
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void PreRAScheduler::dumpDDGContents()
{
IGC_SET_FLAG_VALUE(PrintToConsole, 1);
@@ -259,6 +262,7 @@ void PreRAScheduler::dumpDDGContents()
IGC_SET_FLAG_VALUE(PrintToConsole, 0);
}
+#endif
void PreRAScheduler::clearDDG()
{
@@ -841,6 +845,7 @@ bool PreRAScheduler::ScheduleReadyNodes(
return Changed;
}
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void PreRAScheduler::dumpPriorityQueueContents()
{
llvm::PriorityQueue<Node*, std::vector<Node*>, PreRAScheduler::OrderByLatency> longLatencyQueueCopy = longLatencyDelaySortedReadyQueue;
@@ -912,6 +917,7 @@ void PreRAScheduler::dumpPriorityQueueContents()
IGC_SET_FLAG_VALUE(PrintToConsole, 0);
}
+#endif
bool PreRAScheduler::runOnFunction(Function &F) {
CodeGenContext *ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
--
2.7.4

View File

@ -0,0 +1,34 @@
From 68d99547e620f097b5fca7315d52d411ffc75984 Mon Sep 17 00:00:00 2001
From: Anuj Mittal <anuj.mittal@intel.com>
Date: Fri, 16 Aug 2019 15:49:39 +0800
Subject: [PATCH] suppress warnings being marked as errors
Otherwise when building with clang-8:
| clang-8: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated]
Also see:
https://github.com/intel/intel-graphics-compiler/issues/106
Upstream-Status: Inappropriate
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
IGC/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/IGC/CMakeLists.txt b/IGC/CMakeLists.txt
index 7ff05f3..5deac46 100644
--- a/IGC/CMakeLists.txt
+++ b/IGC/CMakeLists.txt
@@ -2763,7 +2763,7 @@ foreach(_compilerFlagName IN ITEMS "CMAKE_CXX_FLAGS" "CMAKE_C_FLAGS")
-march=corei7
-mstackrealign
-fms-extensions
- -Werror
+ -Wno-error
-Wno-unused-parameter
-Wno-missing-field-initializers
-Wwrite-strings
--
2.7.4

View File

@ -5,11 +5,13 @@ hardware architecture."
LICENSE = "MIT & BSD-3-Clause"
LIC_FILES_CHKSUM = "file://IGC/BiFModule/Implementation/ExternalLibraries/libclc/LICENSE.TXT;md5=311cfc1a5b54bab8ed34a0b5fba4373e \
file://IGC/Compiler/LegalizationPass.cpp;md5=4e9a7f0d710a0546cbf5581e1565a986"
file://IGC/Compiler/LegalizationPass.cpp;beginline=1;endline=25;md5=4abf1738ff96b18e34186eb763e28eeb"
SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https \
file://0001-skip-execution-of-ElfPackager.patch \
file://0001-suppress-warnings-being-marked-as-errors.patch \
file://0001-Fix-for-the-gcc-9-issue.patch \
file://0001-comment-out-dump-functions.patch \
"
SRCREV = "ebfc688126900a821e407a96417800919b793447"
@ -21,9 +23,14 @@ inherit cmake
COMPATIBLE_HOST = '(x86_64).*-linux'
COMPATIBLE_HOST_libc-musl = "null"
DEPENDS_class-target = " flex-native bison-native clang clang-cross-x86_64"
DEPENDS += " flex-native bison-native clang opencl-clang"
DEPENDS_append_class-target = " clang-cross-x86_64"
EXTRA_OECMAKE = "-DIGC_PREFERRED_LLVM_VERSION=8.0.0 -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python2"
EXTRA_OECMAKE += "-DCOMMON_CLANG_LIBRARY_NAME=common_clang"
LDFLAGS_append_class-native = " -fuse-ld=lld"
TOOLCHAIN_class-native = "clang"
BBCLASSEXTEND = "native nativesdk"
UPSTREAM_CHECK_GITTAGREGEX = "^igc-(?P<pver>(?!19\..*)\d+(\.\d+)+)$"