Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make intrinsics module searching more robust #114

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
d864dbb
Add passing CMEntry attribute through CM Adaptor
DmitryBushev Nov 26, 2020
ae497dc
Sync changes
aus-intel Mar 23, 2021
0d75203
Add interface to exctract hash commit of the build
DmitryBushev Nov 30, 2020
a2869bb
Fix in-tree GenXIntrinsics build fail
DmitryBushev Dec 3, 2020
3b10484
Fix version info collection
DmitryBushev Feb 12, 2021
577fb7b
Remove unnecessary semicolons that throw warnings
Feb 18, 2021
d547de9
Fix for build that skips root vc-intrinsics dir
DmitryBushev Mar 4, 2021
e657f3b
Small cleanup in intrinsics cmake
aus-intel Mar 29, 2021
069ced1
implemented utility function to help with genx_XXmul construction
aparshin-intel Apr 2, 2021
2d0795c
Preserve comdat info in GenXSPIRV adaptors when rewrite types
NikitaRudenkoIntel Apr 28, 2021
93d676b
Fix comments
gvsharap Jun 7, 2021
a94249a
Update licenses
intel-kzhavoro Jun 2, 2021
19e6dda
Wrap getName function
aus-intel Jun 15, 2021
3303f8d
made Intrinsics parameters named
vchernon-intel Jun 7, 2021
475fb7f
made intrinsics definitions multilined
vchernon-intel Jun 17, 2021
efec192
Add new field to vc-intrinsics.
vchernon-intel Jun 23, 2021
b976b83
introduce bf_cvt intrinsic
itetyush-intel Jun 23, 2021
6d29de3
update comment format of rst copyright headers
lukaszgotszaldintel Jul 1, 2021
d9ffe1f
Add intrinsics for bindless buffers support
aus-intel Jul 7, 2021
f45e04c
Introduce new vc intrinsic to access timestamp register
IDmitryy Jul 20, 2021
63cbfe0
update MIT copyright headers
lukaszgotszaldintel Jul 6, 2021
185f382
update copyright headers
lukaszgotszaldintel Jul 22, 2021
43b1af8
Fix typo in GenXIntrinsics/CMakeLists.txt
NikitaRudenkoIntel Jul 27, 2021
05d3f3d
Add global variables support to GenXSingleElementVector pass
NikitaRudenkoIntel Jun 24, 2021
0bf761e
Mark lit tests as XFAIL for llvm 14 (tot)
IDmitryy Jul 29, 2021
4e3870d
Revert "Introduce new vc intrinsic to access timestamp register"
IDmitryy Jul 29, 2021
90113a5
add intrinsic to represent visa madw instr
kyansito Jul 30, 2021
fd9bf4b
Wrap AttributeList::hasFnAttr
aus-intel Aug 16, 2021
2bbb573
Add missing header
Bargatin-Intel Aug 18, 2021
6221091
Fix llvm verifier assertion
DmitryBushev Aug 19, 2021
a2f2f10
Fix Cmake Error
DenisBakhvalov Aug 19, 2021
006d176
Remove odd specifiers from functions in headers
aus-intel Aug 20, 2021
b66c5bb
Add intrinsics to represent cm_imul builtin
kyansito Aug 31, 2021
b1db3e5
Wrap attribute at index methods
aus-intel Sep 3, 2021
e5ad7e0
Add image array conversion in spirv adaptors
aus-intel Sep 7, 2021
4e2a1ce
synchornize platform list
aparshin-intel Sep 8, 2021
7a46e7e
More robust procedure to query availability of an intrinsic on a part…
aparshin-intel Sep 10, 2021
5647df3
Add 3rd argument for imad
kyansito Sep 13, 2021
085fcac
In case there no kernels in module, SPIRV adaptor passes would skip p…
DmitryBushev Sep 7, 2021
5c8159a
Cleanup unnecessary/deprecated attributes from test
aparshin-intel Sep 26, 2021
465abdd
Add media block images to SPIRV adaptors
aus-intel Sep 23, 2021
9aafb51
SPIRV-LLVM-Translator may convert native SPIRV types to 'SPIRV friend…
DmitryBushev Sep 28, 2021
2140c91
spirv reader adaptor should discard redundant attributes
aparshin-intel Oct 1, 2021
2cd5a7b
introduce new RKL platform
aparshin-intel Oct 7, 2021
6a7e93d
Wrap arg_size for call instructions
aus-intel Oct 18, 2021
d6d08b3
Bump minimum supported LLVM version to 8
aus-intel Oct 19, 2021
ed60a79
Updating source files permissions
ssidelni Oct 25, 2021
c6e0c45
Normalize ifs in cmake code
aus-intel Oct 27, 2021
4f46071
Fixed SPIRVWriterAdaptor pass not adding attribute on address convert…
DmitryBushev Oct 12, 2021
8ee8793
Introducing VC intrinsics interface for DG2 and PVC platforms
Nov 2, 2021
381535d
Stack calls are not necessary to be noinline
Dec 2, 2021
d3cef33
Fix lack of includes in GenXMetadata.h
dmitryryintel Dec 9, 2021
84308be
Provide cmake error when unsupported LLVM found
aus-intel Oct 29, 2021
09ff7f8
Remove wrappers for LLVM 7
aus-intel Oct 26, 2021
753ad50
Remove legacy simd8 intrinsics
aus-intel Oct 7, 2021
3a5f4b4
Fix buildfail on ToT caused by D116110
aus-intel Jan 11, 2022
d2f78f2
Fix an issue with GenXIntrinsicDescription.gen includes
sergey-semenov Jan 25, 2022
a7a3efa
Fix potential null pointer dereference
aparshin-intel Jan 26, 2022
a3ca3a3
Set some tests to XFAIL on latest LLVM 15
NikitaRudenkoIntel Feb 3, 2022
a9bb6d8
Fix attributes are not forwarded for call inst with SEV
NikitaRudenkoIntel Feb 1, 2022
5066d94
add ADLP and ADLS platforms
vchernon-intel Feb 7, 2022
91071ac
Add add3c intrinsic
ytarasov-intel Feb 8, 2022
9b2ae13
Remove XFAIL from some tests
NikitaRudenkoIntel Feb 4, 2022
8b6e209
introducing named barrier support in adaptor pass
Feb 8, 2022
e45940b
Use getPointerElementType for pointee types
aus-intel Feb 14, 2022
a727062
Rename exported package
aus-intel Feb 14, 2022
328694a
Remove duplication of source list
aus-intel Feb 21, 2022
e9fa035
Add interface includes for in-tree mode
aus-intel Feb 21, 2022
3b94702
Correct/improve lsc messages documentation
Feb 21, 2022
8db8345
Fill debug values in created instructions
igorban-intel Feb 25, 2022
99ac111
add PVCXT_A0 platfrom
aparshin-intel Mar 16, 2022
c97396d
Extend GenXIntrinsics interface
BruceGliff Mar 30, 2022
7bcfff9
[ESIMD] Add slm_init intrinsic for variable slm size support.
kychendev Apr 22, 2022
1e2562d
Restore intrinsics order
vmustya Apr 25, 2022
561f4ff
Remove default switch labels for LSC-related functions
vmustya May 3, 2022
1fad747
Fix LSC helpers
vmustya May 10, 2022
4ce354d
Fix for build as part of igc
vmustya May 11, 2022
abce918
Format InstructionSimplify names
HaohaiWen Jun 10, 2022
984bb27
Support ADLN platform
vmustya Jun 17, 2022
c456ff0
Add support for LLVM_LINK_LLVM_DYLIB option
fineg74 Jul 6, 2022
f67c21c
Make intrinsics module searching more robust
romanovvlad Aug 31, 2022
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
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#==============================================================================#
# This file specifies intentionally untracked files that git should ignore.
# See: http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
#
# This file is intentionally different from the output of `git svn show-ignore`,
# as most of those are useless.
#==============================================================================#

#==============================================================================#
# File extensions to be ignored anywhere in the tree.
#==============================================================================#
# Temp files created by most text editors.
*~
# Merge files created by git.
*.orig
# Byte compiled python modules.
*.pyc
# vim swap files
.*.sw?
.sw?
#OS X specific files.
.DS_store

# Nested build directory
/build

#==============================================================================#
# Explicit files to ignore (only matches one).
#==============================================================================#
# Various tag programs
/tags
/TAGS
/GPATH
/GRTAGS
/GSYMS
/GTAGS
.gitusers
autom4te.cache
cscope.files
cscope.out
autoconf/aclocal.m4
autoconf/autom4te.cache
/compile_commands.json
tags
# Visual Studio built-in CMake configuration
/CMakeSettings.json
# CLion project configuration
/.idea

#==============================================================================#
# Directories to ignore (do not add trailing '/'s, they skip symlinks).
#==============================================================================#
# Sphinx build tree, if building in-source dir.
GenXIntrinsics/docs/_build
GenXIntrinsics/docs/autogenerated
# VS2017 and VSCode config files.
.vscode
.vs
# clangd index
.clangd
28 changes: 18 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================

cmake_minimum_required(VERSION 3.13.4)

set(LLVM_GENX_INTRINSICS_VERSION 1.0)

set(LLVM_GENX_INTRINSICS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

# check if we build inside llvm or not
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
get_filename_component(LLVM_CMAKE_PATH ${LLVM_DIR} ABSOLUTE BASE_DIR ${CMAKE_BINARY_DIR})
set(BUILD_EXTERNAL YES)
if (NOT DEFINED INSTALL_REQUIRED)
if(NOT DEFINED INSTALL_REQUIRED)
set(INSTALL_REQUIRED YES)
endif()
project(LLVM_GenXIntrinsics
Expand Down Expand Up @@ -36,28 +46,26 @@ else(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)

# LLVM_CMAKE_DIR is not set for non-standalone builds. Use LLVM_CMAKE_PATH
# instead. (see clang/CMakeLists.txt)
if (NOT LLVM_CMAKE_DIR)
if(NOT LLVM_CMAKE_DIR)
set(LLVM_CMAKE_DIR ${LLVM_CMAKE_PATH})
endif()

# we require include_directories because other components may include intrinsics headers.
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/GenXIntrinsics/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/GenXIntrinsics/include)
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)

if(LLVM_VERSION_MAJOR VERSION_LESS 8)
message(FATAL_ERROR "VC-intrinsics do not support ${LLVM_VERSION} LLVM version")
endif()

include(FindPythonInterp)
if( NOT PYTHONINTERP_FOUND )
if(NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR
"Unable to find Python interpreter, required for builds and testing.

Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
endif()

if( "${PYTHON_VERSION_STRING}" VERSION_LESS 2.7 )
if("${PYTHON_VERSION_STRING}" VERSION_LESS 2.7)
message(FATAL_ERROR "Python 2.7 or newer is required")
endif()


add_subdirectory(GenXIntrinsics)


23 changes: 23 additions & 0 deletions GenXIntrinsics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================

cmake_minimum_required(VERSION 3.13.4)
include(GNUInstallDirs)

set(GENX_INTRINSICS_MAIN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)

set(GENX_INTRINSICS_MAIN_DIR ${CMAKE_CURRENT_SOURCE_DIR})

if(IGC_INFRA)
set(GENX_INTRINSICS_MAIN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)
endif()

include(cmake/utils.cmake)

# Global config.
add_compile_definitions(VC_INTR_LLVM_VERSION_MAJOR=${LLVM_VERSION_MAJOR})

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)

set(GENX_INTRINSICS_DESCRIPTION "GenXIntrinsicDescription.gen")

add_subdirectory(include/llvm)
Expand Down Expand Up @@ -59,9 +75,16 @@ if(INSTALL_REQUIRED)
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

# Legacy export. To remove when all clients switch to new name.
install(EXPORT LLVMGenXIntrinsicsTargets
FILE LLVMGenXIntrinsicsConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LLVMGenXIntrinsics
)

set(PACKAGE_NAME VCIntrinsics${LLVM_VERSION_MAJOR})
install(EXPORT LLVMGenXIntrinsicsTargets
FILE ${PACKAGE_NAME}Config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PACKAGE_NAME}
)
endif() # BUILD_EXTERNAL
endif() # INSTALL_REQUIRED
8 changes: 8 additions & 0 deletions GenXIntrinsics/cmake/utils.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================

# Convenience function to get list of LLVM components for
# target_link_library. If LLVM was configured with llvm dylib, then
# included in dylib llvm targets should be replaced with LLVM
Expand Down
8 changes: 8 additions & 0 deletions GenXIntrinsics/docs/GenXLangRef.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.. ========================= begin_copyright_notice ============================

Copyright (C) 2015-2021 Intel Corporation

SPDX-License-Identifier: MIT

=========================== end_copyright_notice =============================

============================
LLVM IR for the GenX backend
============================
Expand Down
8 changes: 8 additions & 0 deletions GenXIntrinsics/docs/LangRefIndex.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.. ========================= begin_copyright_notice ============================

Copyright (C) 2019-2021 Intel Corporation

SPDX-License-Identifier: MIT

=========================== end_copyright_notice =============================

VC Intrinsics documentation (language reference)
==================================================

Expand Down
8 changes: 8 additions & 0 deletions GenXIntrinsics/docs/Makefile.sphinx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================

# Minimal makefile for Sphinx documentation
#

Expand Down
8 changes: 8 additions & 0 deletions GenXIntrinsics/docs/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!---======================= begin_copyright_notice ============================

Copyright (C) 2021 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ==========================-->

8 changes: 8 additions & 0 deletions GenXIntrinsics/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# ========================== begin_copyright_notice ============================
#
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
# =========================== end_copyright_notice =============================

# -*- coding: utf-8 -*-
#
# VC Intrinsics documentation build configuration file.
Expand Down
8 changes: 8 additions & 0 deletions GenXIntrinsics/include/llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================

add_subdirectory(GenXIntrinsics)
44 changes: 44 additions & 0 deletions GenXIntrinsics/include/llvm/GenXIntrinsics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${GENX_INTRINSICS_DESCRIPTION}
COMMAND ${PYTHON_EXECUTABLE} -B
Expand All @@ -10,8 +18,44 @@ add_custom_command(
COMMENT "Building ${GENX_INTRINSICS_DESCRIPTION}..."
)

find_first_existing_vc_file(intrinsics_vc "${GENX_INTRINSICS_MAIN_DIR}")

set(version_inc ${CMAKE_CURRENT_BINARY_DIR}/GenXVersion.inc)

if(LLVM_GENX_INTRINSICS_ROOT_DIR)
set(LLVM_GENX_INTRINSICS_REPO_DIR ${LLVM_GENX_INTRINSICS_ROOT_DIR})
else()
set(LLVM_GENX_INTRINSICS_REPO_DIR ${GENX_INTRINSICS_MAIN_DIR}/..)
endif()

if(${LLVM_VERSION_MAJOR} LESS 9)
find_file(FOUND_VCS GetSVN.cmake PATHS ${LLVM_CMAKE_DIR} REQUIRED)
add_custom_command(
OUTPUT "${version_inc}"
COMMAND
${CMAKE_COMMAND} "-DSOURCE_DIRS=${LLVM_GENX_INTRINSICS_REPO_DIR}"
"-DNAMES=VCI"
"-DHEADER_FILE=${version_inc}"
-P "${FOUND_VCS}")
else()
find_file(FOUND_VCS VersionFromVCS.cmake PATHS ${LLVM_CMAKE_DIR} REQUIRED)
add_custom_command(
OUTPUT "${version_inc}"
COMMAND
${CMAKE_COMMAND} "-DSOURCE_DIR=${LLVM_GENX_INTRINSICS_REPO_DIR}"
"-DNAME=VCI"
"-DHEADER_FILE=${version_inc}"
"-DVCS_SCRIPT=${FOUND_VCS}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/ConfigureVersionFile.cmake")
endif()

set_source_files_properties("${version_inc}"
PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE)

add_custom_target(GenXIntrinsicDescriptionGen
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${GENX_INTRINSICS_DESCRIPTION}
${version_inc}
)
add_custom_target(GenXIntrinsicsGen)
add_dependencies(GenXIntrinsicsGen GenXIntrinsicDescriptionGen)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================

include(${VCS_SCRIPT})

function(generate_version_file output_file)
get_source_info(${SOURCE_DIR} rev repo)
file(APPEND "${output_file}.txt" "#define ${NAME}_REVISION \"${rev}\"\n")
file(APPEND "${output_file}.txt" "#define ${NAME}_REPOSITORY \"${repo}\"\n")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${output_file}.txt" "${output_file}")
file(REMOVE "${output_file}.txt")

endfunction()

generate_version_file(${HEADER_FILE})

26 changes: 15 additions & 11 deletions GenXIntrinsics/include/llvm/GenXIntrinsics/GenXIntrOpts.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
//===-- GenXIntrOpts.h - GenX Transformations -------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
/*========================== begin_copyright_notice ============================

Copyright (C) 2020-2021 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/

/*========================== begin_copyright_notice ============================

This file is distributed under the University of Illinois Open Source License.
See LICENSE.TXT for details.

============================= end_copyright_notice ===========================*/

// This header file defines prototypes for accessor functions that expose passes
// in the GenX Intrinsics transformations library.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_GENX_INTR_OPTS_H
#define LLVM_GENX_INTR_OPTS_H
Expand Down
Loading