summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/llvm
Commit message (Collapse)AuthorAgeFilesLines
* clover: fix getting scalar args api sizeSerge Martin2016-09-161-4/+3
| | | | | | | | This fix getting the size of a struct arg. vec3 types still work ok. Only buit-in args need to have power of two alignment, getTypeAllocSize reports the correct size in all cases. Acked-by: Francisco Jerez <currojerez@riseup.net>
* st/clover: Define __OPENCL_VERSION__ on the device sideNiels Ole Salscheider2016-09-101-0/+3
| | | | | | | | This is required by the OpenCL standard. Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Vedran Miletić <vedran@miletic.net>
* clover: make GCC 4.8 happyDieter Nützel2016-07-271-1/+1
| | | | | | | | | | | | | | | Without this GCC 4.8.x throws below error: error: invalid initialization of non-const reference of type 'clover::llvm::compat::raw_ostream_to_emit_file {aka llvm::raw_svector_ostream&}' from an rvalue of type '<brace-enclosed initializer list>' v2: change commit title and add error message like Eric Engestrom requested Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97019 [ Francisco Jerez: Trivial formatting fix. ] Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* clover: Re-order includes in invocation.cpp to fix buildTom Stellard2016-07-201-7/+17
| | | | | | | | | | | | The build was failing because the official CL headers have a few defines, like: # define cl_khr_gl_sharing 1 Which have the same name as some class members of clang's OpenCLOptions class. If we include the cl headers first, this breaks the build because the member names of this class are replaced by the literal 1. Reviewed-by: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Vedran Miletić <vedran@miletic.net>
* clover: Add missing include v2Tom Stellard2016-07-201-0/+1
| | | | | | | | | | | clang commit r275822 removed unnecessary includes from header files, so we now need to explicitly include clang/Lex/PreprocessorOptions.h v2: - Use <> instead of "" for the include path. Reviewed-by: Francisco Jerez <currojerez@riseup.net> Reviewed-by: Vedran Miletić <vedran@miletic.net>
* clover/core: Remove compiler.hpp.Francisco Jerez2016-07-111-1/+1
| | | | | | | | header_map was the only definition left in compiler.hpp, move it into program.hpp which is its only user in clover/core. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Get rid of compile_program_llvm().Francisco Jerez2016-07-111-11/+0
| | | | | | | Superseded by compile_program() and link_program(). Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover: Define error subclass to signal build option parse failure.Francisco Jerez2016-07-111-1/+1
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover: Move back to using build_error to signal compilation failure.Francisco Jerez2016-07-112-7/+7
| | | | | | | | | | | | | | This partially reverts 7e0180d57d330bd8d3047e841086712376b2a1cc. Having two different exception subclasses for compilation and linking makes it more difficult to share or move code between the two codepaths, because the exact same function under the same error condition would need to throw one exception or the other depending on what top-level API is being implemented with it. There is little benefit anyway because clCompileProgram() and clLinkProgram() can tell whether they are linking or compiling a program. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Implement the -create-library linker option.Francisco Jerez2016-07-111-24/+23
| | | | | | | | [ Serge Martin: disable internalize pass when building a library. Otherwise some functions may be inlined and removed ] Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Implement linkage of multiple clover modules.Francisco Jerez2016-07-112-3/+35
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Split compilation and linking.Francisco Jerez2016-07-112-15/+90
| | | | | | | | | | | | Split the work previously done by compile_program_llvm() into compile_program() (which simply runs the front-end and serializes the resulting LLVM IR) and link_program() (which takes care of everything else down to binary codegen). [ Serge Martin: allow LLVM IR dump after compilation ] Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Implement library bitcode codegen.Francisco Jerez2016-07-112-1/+31
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Trivial assorted cleanups for invocation.cpp.Francisco Jerez2016-07-111-50/+7
| | | | | | | Drop a few include and using directives which are no longer necessary. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Split native codegen into separate file.Francisco Jerez2016-07-113-119/+174
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Split bitcode codegen into separate file.Francisco Jerez2016-07-113-35/+83
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Split shared codegen support code into separate file.Francisco Jerez2016-07-113-157/+259
| | | | | | | | This is the common part of the code used to generate a clover::module from LLVM bitcode, shared between the native and LLVM paths. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Define function for bitcode print-out.Francisco Jerez2016-07-111-7/+10
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Split native codegen and assembly print-out into separate ↵Francisco Jerez2016-07-111-18/+20
| | | | | | | functions. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Clean up bitcode codegen.Francisco Jerez2016-07-111-16/+20
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Use metadata introspection utils for kernel enumeration.Francisco Jerez2016-07-111-31/+3
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Use metadata introspection utils for kernel argument set-up.Francisco Jerez2016-07-111-92/+5
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Add simplified utility functions for metadata introspection.Francisco Jerez2016-07-111-0/+132
| | | | | | | v2: Fix for latest LLVM from SVN. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> (v1) Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Clean up codestyle of get_kernel_args().Francisco Jerez2016-07-111-120/+103
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Fold compile_native() call into build_module_native().Francisco Jerez2016-07-111-6/+4
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Factor out duplicated construction of clover::module.Francisco Jerez2016-07-111-47/+41
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Clean up compile_native().Francisco Jerez2016-07-113-63/+74
| | | | | | | | | | | | | This switches compile_native() to the C++ API (which the rest of this file makes use of anyway so there is little benefit from using the C API), what should get rid of an amount of boilerplate and fix a leak of the TargetMachine object in the error path. v2: Additional fixes for LLVM 3.6. v3: Update for the latest LLVM SVN changes. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Clean up ELF parsing.Francisco Jerez2016-07-111-55/+52
| | | | | | | | | | | | | | This function was doing three separate things: - Initializing and releasing the ELF parsing state (the latter can be better done using RAII). - Searching for the symbol table in the ELF file. - Extraction of kernel symbol offsets from the symbol table. Split each one into a separate function for clarity and clean up the result slightly. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Move a bunch of utility functions into separate file.Francisco Jerez2016-07-112-60/+99
| | | | | | | | Some of these will be useful from a different compilation unit in the same subtree so put them in a publicly accessible header file. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Tidy debug handling.Francisco Jerez2016-07-111-40/+41
| | | | | | | | Most significant change is debugging flags are now a scoped enum and all debugging helpers live in the debug namespace. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Use helper function to abort compilation with error message.Francisco Jerez2016-07-111-27/+29
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Simplify diagnostic_handler().Francisco Jerez2016-07-111-9/+5
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Trivial codestyle clean-up for optimize().Francisco Jerez2016-07-111-13/+13
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Clean up compilation into LLVM IR.Francisco Jerez2016-07-111-30/+22
| | | | | | | | Some assorted and mostly trivial clean-ups for the source to bitcode compilation path. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Factor out LLVM context init.Francisco Jerez2016-07-111-40/+43
| | | | | | | So it can be shared between the compilation and linking codepaths. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Declare compiler instance at top level and pass down as argument.Francisco Jerez2016-07-111-27/+15
| | | | | | | | | | | This allows simplifying the interface of compile_llvm() because it no longer needs to read out and return the optimization level and address space map from the compiler instance. Instead declare the compiler instance at the top level so that both properties are available directly. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Refactor compiler instance initialization.Francisco Jerez2016-07-111-52/+47
| | | | | | | This will be shared between the compiler and linker codepaths. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Factor out compiler option tokenization.Francisco Jerez2016-07-111-12/+13
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Factor out target string parsing.Francisco Jerez2016-07-111-21/+24
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Collect #ifdef mess into a separate file.Francisco Jerez2016-07-112-75/+156
| | | | | | | | | This gets rid of most ifdef's from the invocation.cpp code -- Only a couple of them are left which will be removed differently in the following commits. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Drop dead code.Francisco Jerez2016-07-111-40/+0
| | | | | | | | | | This ifdef'ed out code was meant to handle compilation into TGSI, but it doesn't seem likely that it will ever be useful even if the TGSI back-end is resurrected because the TGSI bitcode can just be plumbed through in ELF format and dealt with as a regular "native" back-end. Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover/llvm: Drop support for LLVM < 3.6.Francisco Jerez2016-07-111-36/+4
| | | | | Reviewed-by: Serge Martin <edb+mesa@sigluy.net> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
* clover: Fix kernel metadata retrieval after clang r273425Jan Vesely2016-06-271-4/+31
| | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Acked-by: Francisco Jerez <currojerez@riseup.net>
* clover/llvm: Fix copyright attribution of invocation.cpp.Francisco Jerez2016-06-271-1/+5
| | | | | | | | | | This file still only has my name on the copyright notice even though most of the code (likely more than 90% of it) was authored by various contributors -- It doesn't seem right to have the whole file attributed to myself. Acked-by: Michel Dänzer <michel.daenzer@amd.com> Acked-by: Serge Martin <edb+mesa@sigluy.net>
* clover: Fix build against clang SVN >= r273191Vedran Miletić2016-06-211-1/+1
| | | | | | setLangDefaults() now requires PreprocessorOptions as an argument. Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
* clover: Handle PIPE_SHADER_IR_NIR in switchJan Vesely2016-05-151-1/+2
| | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* clover: Fix build against clang SVN >= r267772Michel Dänzer2016-04-281-0/+3
| | | | | | | | (Re-pushing previous fix for clang SVN r265359, which was reverted in the meantime) Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
* clover: Fix build against LLVM SVN >= r266163Michel Dänzer2016-04-141-0/+14
| | | | | | createInternalizePass now takes a callback instead of a StringSet. Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* Revert "clover: Fix build against clang SVN >= r265359"Michel Dänzer2016-04-071-3/+0
| | | | | | | | This reverts commit 0daab9878d2b96356cf667591a2c877d912be52d. The corresponding clang change was reverted. Trivial.
* clover: Fix build against clang SVN >= r265359Michel Dänzer2016-04-051-0/+3
| | | | | Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>