Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ git:

branches:
only:
- master
- ocl-open-130

env:
global:
- LLVM_VERSION=12
- LLVM_VERSION=13
matrix:
- BUILD_TYPE=Release
- BUILD_TYPE=Debug
Expand All @@ -31,14 +31,17 @@ before_install:
libclang-cpp${LLVM_VERSION}-dev

install:
- wget https://github.com/KhronosGroup/SPIRV-LLVM-Translator/releases/download/dev-build/SPIRV-LLVM-Translator-dev-build-linux-Release.zip -O /tmp/SPIRV-LLVM-Translator-dev-build-linux-${BUILD_TYPE}.zip
- unzip /tmp/SPIRV-LLVM-Translator-dev-build-linux-${BUILD_TYPE}.zip -d spirv-llvm-translator
- git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git spirv-llvm-translator -b llvm_release_${LLVM_VERSION}0
- mkdir spirv-llvm-translator/build && cd spirv-llvm-translator/build
- cmake .. -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make -j`nproc` && make install
- cd ../../

compiler:
- gcc
- clang

script:
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLLVM_NO_DEAD_STRIP=ON -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=./spirv-llvm-translator -DCMAKE_INSTALL_PREFIX=./install ..
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DLLVM_NO_DEAD_STRIP=ON -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=${TRAVIS_BUILD_DIR}/spirv-llvm-translator/build/install -DCMAKE_INSTALL_PREFIX=./install ..
- make install
27 changes: 17 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@ set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )
if(NOT USE_PREBUILT_LLVM)

if(NOT LLVM_EXTERNAL_CLANG_SOURCE_DIR)
set(LLVM_BASE_REVISION release_13)
set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/tools/clang)
set(CLANG_BASE_REVISION release_13)
elseif(EXISTS "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/CMakeLists.txt")
set(LLVM_BASE_REVISION release/13.x)
set(CLANG_SOURCE_DIR "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
set(CLANG_BASE_REVISION release/13.x)
endif()
if(EXISTS ${CLANG_SOURCE_DIR})
message(STATUS "[OPENCL-CLANG] Using Clang source code direcotry: ${CLANG_SOURCE_DIR}")
Expand Down Expand Up @@ -116,19 +120,22 @@ if(NOT USE_PREBUILT_LLVM)
"out at `llvm/projects/llvm-spirv`"
)
endif()

set(CLANG_BASE_REVISION master)
set(SPIRV_BASE_REVISION master)
set(TARGET_BRANCH "ocl-open-110")

apply_patches(${CLANG_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang
${CLANG_BASE_REVISION}
${TARGET_BRANCH})

set(SPIRV_BASE_REVISION llvm_release_130)
set(TARGET_BRANCH "ocl-open-130")
get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
apply_patches(${LLVM_MONOREPO_DIR}
"${LLVM_PATCHES_DIRS}"
${LLVM_BASE_REVISION}
${TARGET_BRANCH}
ret)
apply_patches(${SPIRV_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
${SPIRV_BASE_REVISION}
${TARGET_BRANCH})
${TARGET_BRANCH}
ret)
endif(NOT USE_PREBUILT_LLVM)

#
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Before the build all dependencies must be downloaded and laid out as follows:
This can be done using the following commands:
```bash
cd <workspace>
git clone https://github.com/llvm/llvm-project.git .
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git
git clone https://github.com/intel/opencl-clang.git
git clone https://github.com/llvm/llvm-project.git . -b release/13.x
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git -b llvm_release_130
git clone https://github.com/intel/opencl-clang.git -b ocl-open-130
```

Then we need to create a build directory and run the build:
Expand Down Expand Up @@ -58,7 +58,7 @@ documented in [Embedding LLVM in your project](https://llvm.org/docs/CMake.html#
Commands to checkout sources and build:
```bash
cd <workspace>
git clone https://github.com/intel/opencl-clang.git
git clone https://github.com/intel/opencl-clang.git -b ocl-open-130
mkdir build && cd build
cmake ../opencl-clang
make all -j`nproc`
Expand All @@ -68,7 +68,7 @@ make all -j`nproc`

##### Preferred LLVM version

By default, openclc-clang's cmake script is searching for LLVM 12.0.0. You can
By default, opencl-clang's cmake script is searching for LLVM 12.0.0. You can
override target version of LLVM by using the `PREFERRED_LLVM_VERSION` cmake
option:

Expand Down
1 change: 0 additions & 1 deletion options_compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args,
effectiveArgs.push_back("-cl-kernel-arg-info");
effectiveArgs.push_back("-fno-validate-pch");
effectiveArgs.push_back("-fno-caret-diagnostics");
effectiveArgs.push_back("-dwarf-column-info");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this line removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://reviews.llvm.org/rGb0b5162fc23c55906a461366f8acef2431d951c5, the -dwarf-column-info flag is no longer available.
branch 11 and 12 have same changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. we need to remove it from master branch as well.


if (std::find_if(effectiveArgs.begin(), effectiveArgs.end(),
[](const ArgsVector::value_type& a) {
Expand Down