Re: [Mesa-dev] [PATCH] clover: adapt to new error API since LLVM r286752

2016-11-14 Thread Francisco Jerez
Jan Vesely writes: > On Mon, 2016-11-14 at 12:17 +0100, Vedran Miletić wrote: >> --- >> src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp | 10 -- >> 1 file changed, 8 insertions(+), 2 deletions(-) >> >> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp >

Re: [Mesa-dev] [PATCH 1/2] mesa: add NV_image_formats extension support

2016-11-14 Thread Francisco Jerez
Ilia Mirkin writes: > On Mon, Nov 14, 2016 at 6:55 AM, Lionel Landwerlin > wrote: >> On 11/11/16 18:39, Ilia Mirkin wrote: >>> On Fri, Nov 11, 2016 at 10:40 AM, Lionel Landwerlin >>> wrote: diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 2d

Re: [Mesa-dev] [PATCH v2] clover: add GetKernelArgInfo (CL 1.2)

2016-11-14 Thread Francisco Jerez
Serge Martin writes: > On Sunday 30 October 2016 16:07:25 Francisco Jerez wrote: >> Serge Martin writes: >> > --- >> > >> > src/gallium/state_trackers/clover/api/kernel.cpp | 47 >> > -- >> > src/gallium/state_track

Re: [Mesa-dev] [PATCH v4] clover: restore support for LLVM <= 3.9

2016-11-19 Thread Francisco Jerez
oBase &EIB) { > + fail(r_log, error(CL_INVALID_PROGRAM), > EIB.message().c_str()); > + }); > +} > +#else > +if (!mod) > + fail(r_log, error(CL_INVALID_PROGRAM), > mod.getError().message()); > +#endif T

Re: [Mesa-dev] [PATCH] clover: Implement clSetCommandQueueProperty() from OpenCL 1.0

2016-11-19 Thread Francisco Jerez
Edward O'Callaghan writes: > Signed-off-by: Edward O'Callaghan > --- > include/CL/cl.h| 6 > src/gallium/state_trackers/clover/api/dispatch.cpp | 2 +- > src/gallium/state_trackers/clover/api/queue.cpp| 34 > ++ > src/gallium/s

Re: [Mesa-dev] [PATCH v2] clover: restore support for LLVM <= 3.9

2016-11-24 Thread Francisco Jerez
Emil Velikov writes: > On 17 November 2016 at 17:27, Emil Velikov wrote: > >> Admittedly not a huge C++ expert, but what's wrong with having a >> simple 5 line patch that adds the original code in a if guard ? >> If then the LLVM <= 3.9 codepath is (somewhat) wrong, let's tackle >> that separate

Re: [Mesa-dev] [PATCH v5] clover: restore support for LLVM <= 3.9

2016-11-24 Thread Francisco Jerez
LLVM 3.6-3.8 > v4: add missing #ifdef around > v5: simplify using templates and lambda > > Signed-off-by: Vedran Miletić > Reviewed-by[v2]: Jan Vesely > Tested-by[v4]: Vinson Lee > Tested-by[v4]: Pierre Moreau > Reviewed-by: Francisco Jerez > --- > .../state_t

Re: [Mesa-dev] [PATCH v5] clover: restore support for LLVM <= 3.9

2016-11-24 Thread Francisco Jerez
r for LLVM. >> >> v2: merged #ifdef blocks >> v3: added support for LLVM 3.6-3.8 >> v4: add missing #ifdef around >> v5: simplify using templates and lambda >> >> Signed-off-by: Vedran Miletić >> Reviewed-by[v2]: Jan Vesely >> Tested-by[v4]: V

Re: [Mesa-dev] [PATCH 1/4] clover: Implement 'CL_MEM_OBJECT_IMAGE2D_ARRAY'

2016-11-24 Thread Francisco Jerez
Edward O'Callaghan writes: > Signed-off-by: Edward O'Callaghan > --- > src/gallium/state_trackers/clover/api/memory.cpp | 17 - > src/gallium/state_trackers/clover/core/memory.cpp | 14 ++ > src/gallium/state_trackers/clover/core/memory.hpp | 11 +++ > 3 fil

Re: [Mesa-dev] [PATCH 2/4] clover: Implement 'CL_MEM_OBJECT_IMAGE1D'

2016-11-24 Thread Francisco Jerez
Edward O'Callaghan writes: > Signed-off-by: Edward O'Callaghan > --- > src/gallium/state_trackers/clover/api/memory.cpp | 9 - > src/gallium/state_trackers/clover/core/memory.cpp | 13 + > src/gallium/state_trackers/clover/core/memory.hpp | 10 ++ > 3 files changed

Re: [Mesa-dev] [PATCH 4/4] clover: Implement 'CL_MEM_OBJECT_IMAGE1D_ARRAY'

2016-11-24 Thread Francisco Jerez
Edward O'Callaghan writes: > Signed-off-by: Edward O'Callaghan > --- > src/gallium/state_trackers/clover/api/memory.cpp | 13 + > src/gallium/state_trackers/clover/core/memory.cpp | 14 ++ > src/gallium/state_trackers/clover/core/memory.hpp | 11 +++ > 3 files c

Re: [Mesa-dev] [PATCH 3/4] clover: Implement 'CL_MEM_OBJECT_IMAGE1D_BUFFER'

2016-11-24 Thread Francisco Jerez
Edward O'Callaghan writes: > Signed-off-by: Edward O'Callaghan > --- > src/gallium/state_trackers/clover/api/memory.cpp | 9 - > src/gallium/state_trackers/clover/core/memory.cpp | 13 + > src/gallium/state_trackers/clover/core/memory.hpp | 10 ++ > 3 files changed

Re: [Mesa-dev] clover: OpenCL image support

2016-11-24 Thread Francisco Jerez
Edward O'Callaghan writes: > The following series implements what is needed on clover's > side for OpenCL image support. This seems to work with some > basic applications with radeonsi. Although, I have not yet > included the patch to enable by default until the LLVM bugs > this can potentially t

Re: [Mesa-dev] [PATCH 4/4] i965/sched: Schedule trivial blocks.

2016-11-28 Thread Francisco Jerez
ip <= 1) > - continue; > - >if (reads_remaining) { > memset(reads_remaining, 0, > grf_count * sizeof(*reads_remaining)); Looks good, series is: Reviewed-by: Francisco Jerez > -- > 2.7.3 > > ___

[Mesa-dev] [PATCH 1/9] i965/gen6+: Invalidate constant cache on brw_emit_mi_flush().

2016-12-09 Thread Francisco Jerez
In order to make sure that the constant cache is coherent with previous rendering when we start using it for pull constant loads. --- src/mesa/drivers/dri/i965/brw_pipe_control.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/brw_pipe_control.c b/src/mesa/drivers/dr

[Mesa-dev] [PATCH 3/9] i965/fs: Switch to the constant cache for uniform pull constants.

2016-12-09 Thread Francisco Jerez
This reverts to using the oword block read messages for uniform pull constant loads, as used to be the case until 4c1fdae0a01b3f92ec03b61aac1d3df5. There are two important differences though: Now the L3 cacheability bits are set up correctly for UBOs (since 11f5d8a5d4fbb861ec161f68593e429cbd65d1cd

[Mesa-dev] [PATCH 8/9] i965/fs: Remove the FS_OPCODE_SET_SIMD4X2_OFFSET virtual opcode.

2016-12-09 Thread Francisco Jerez
Not used anymore. It was just a scalar MOV. --- src/mesa/drivers/dri/i965/brw_defines.h| 1 - src/mesa/drivers/dri/i965/brw_fs.h | 3 --- src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 27 -- src/mesa/drivers/dri/i965/brw_shader.cpp | 2 -- 4

[Mesa-dev] [PATCH 5/9] i965/fs: Expose arbitrary pull constant load sizes to the IR.

2016-12-09 Thread Francisco Jerez
Change the FS generator to ask the dataport for enough owords worth of constants to fill the execution size of the instruction -- Which means that the visitor now needs to set the execution size correctly for uniform pull constant load instructions, which we were kind of neglecting until now. ---

[Mesa-dev] [PATCH 2/9] i965: Let the caller of brw_set_dp_write/read_message control the target cache.

2016-12-09 Thread Francisco Jerez
brw_set_dp_read_message already had a target_cache argument, but its interpretation was rather convoluted (on Gen6 the render cache was used if the caller asked for it, otherwise it was ignored using the sampler cache instead), and the constant cache wasn't representable at all. brw_set_dp_write_m

[Mesa-dev] [PATCH 7/9] i965/fs: Drop useless access mode override from pull constant generator code.

2016-12-09 Thread Francisco Jerez
--- src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index e73f2ca..6565f4d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa

[Mesa-dev] [PATCH 4/9] i965: Factor out oword block read and write message control calculation.

2016-12-09 Thread Francisco Jerez
We'll need roughly the same logic in other places and it would be annoying to duplicate it. Instead factor it out into a function-like macro that takes the number of dwords per block (which will prove more convenient than taking the same value in owords or some other unit). --- src/mesa/drivers/d

[Mesa-dev] [PATCH 6/9] i965/fs: Fetch one cacheline of pull constants at a time.

2016-12-09 Thread Francisco Jerez
Asking the DC for less than one cacheline (4 owords) of data for uniform pull constants is suboptimal because the DC cannot request less than that from L3, resulting in wasted bandwidth and unnecessary message dispatch overhead, and exacerbating the IVB L3 serialization bug. The following table su

[Mesa-dev] [PATCH 0/9] i965/fs: Uniform pull constant loads through the constant cache.

2016-12-09 Thread Francisco Jerez
This is a respin of a series I sent nearly two years ago reimplementing uniform pull constant loads in terms of constant cache block read messages instead of using sampler LD messages. The motivation is that oword block read messages are able to fetch more data with a single message than the curre

[Mesa-dev] [PATCH 9/9] i965/disasm: Decode dataport constant cache control fields.

2016-12-09 Thread Francisco Jerez
--- src/mesa/drivers/dri/i965/brw_disasm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index 5e51be7..5930e44 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@

Re: [Mesa-dev] [PATCH v3 1/2] clover: fix sampler argument type detection

2016-12-11 Thread Francisco Jerez
Serge Martin writes: > --- > src/gallium/state_trackers/clover/llvm/codegen/common.cpp | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp > b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp > index 13ccd59..aa6ca50 1

Re: [Mesa-dev] [PATCH 4/9] i965: Factor out oword block read and write message control calculation.

2016-12-11 Thread Francisco Jerez
Kenneth Graunke writes: > On Friday, December 9, 2016 11:03:27 AM PST Francisco Jerez wrote: >> We'll need roughly the same logic in other places and it would be >> annoying to duplicate it. Instead factor it out into a function-like >> macro that takes the number

Re: [Mesa-dev] [PATCH v3 2/2] clover: add GetKernelArgInfo (CL 1.2)

2016-12-11 Thread Francisco Jerez
getFunction(kernel_name); > @@ -161,6 +162,16 @@ namespace { > module::argument::zero_ext)); > } > } > + > + if (get_args_infos) { > +struct module::argument::info i; > +i.index = ar

Re: [Mesa-dev] [PATCH 1/4] clover: Implement 'CL_MEM_OBJECT_IMAGE2D_ARRAY'

2016-12-11 Thread Francisco Jerez
Edward O'Callaghan writes: > On 11/25/2016 03:38 PM, Francisco Jerez wrote: >> Edward O'Callaghan writes: >> >>> Signed-off-by: Edward O'Callaghan >>> --- >>> src/gallium/state_trackers/clover/api/memory.cpp | 17 - &g

Re: [Mesa-dev] [PATCH 2/4] clover: Implement 'CL_MEM_OBJECT_IMAGE1D'

2016-12-11 Thread Francisco Jerez
Edward O'Callaghan writes: > Hi Francisco, thanks for the review.. > > On 11/25/2016 03:39 PM, Francisco Jerez wrote: >> Edward O'Callaghan writes: >> >>> Signed-off-by: Edward O'Callaghan >>> --- >>> src/gallium/state_

Re: [Mesa-dev] [PATCH 1/2] i965: Make DCE set null destinations on messages with side effects.

2016-12-13 Thread Francisco Jerez
Kenneth Graunke writes: > (Co-authored by Matt Turner.) > > Image atomics, for example, return a value - but the shader may not > want to use it. We assigned a useless VGRF destination. This seemed > harmless, but it can actually be quite harmful. The register allocator > has to assign that VG

Re: [Mesa-dev] [PATCH 1/9] i965/gen6+: Invalidate constant cache on brw_emit_mi_flush().

2016-12-13 Thread Francisco Jerez
Kenneth Graunke writes: > On Friday, December 9, 2016 11:03:24 AM PST Francisco Jerez wrote: >> In order to make sure that the constant cache is coherent with >> previous rendering when we start using it for pull constant loads. >> --- >> src/mesa/drivers/dri/i965/brw

Re: [Mesa-dev] [PATCH 6/9] i965/fs: Fetch one cacheline of pull constants at a time.

2016-12-13 Thread Francisco Jerez
Kenneth Graunke writes: > On Friday, December 9, 2016 11:03:29 AM PST Francisco Jerez wrote: >> Asking the DC for less than one cacheline (4 owords) of data for >> uniform pull constants is suboptimal because the DC cannot request >> less than that from L3, resulting in

Re: [Mesa-dev] [PATCH v2 000/103] i965 Haswell ARB_gpu_shader_fp64 / OpenGL 4.0

2016-12-13 Thread Francisco Jerez
Samuel Iglesias Gonsálvez writes: > On Tue, 2016-12-13 at 09:01 +0100, Samuel Iglesias Gonsálvez wrote: >> > [...] >> > i965/vec4/nir: implement double comparisons >> > >> >Trivial: A newline before the if() would be nice. >> > >> >I have a memory of Curro telling me that the hardware

Re: [Mesa-dev] [PATCH 6/9] i965/fs: Fetch one cacheline of pull constants at a time.

2016-12-14 Thread Francisco Jerez
Francisco Jerez writes: > Kenneth Graunke writes: > >> On Friday, December 9, 2016 11:03:29 AM PST Francisco Jerez wrote: >>> Asking the DC for less than one cacheline (4 owords) of data for >>> uniform pull constants is suboptimal because the DC cannot requ

Re: [Mesa-dev] [PATCH 6/9] i965/fs: Fetch one cacheline of pull constants at a time.

2016-12-14 Thread Francisco Jerez
Kenneth Graunke writes: > On Wednesday, December 14, 2016 2:18:16 PM PST Francisco Jerez wrote: >> Francisco Jerez writes: >> >> > Kenneth Graunke writes: >> > >> >> On Friday, December 9, 2016 11:03:29 AM PST Francisco Jerez wrote: >> >

[Mesa-dev] [PATCH] anv: Fix uniform and storage buffer offset alignment limits.

2016-12-15 Thread Francisco Jerez
This fixes an apparent regression in a bunch of image store vulkan CTS tests from commit ad38ba113491869ab0dffed937f7b3dd50e8a735, which started using OWORD block read messages to implement UBO loads. The reason for the failure is that we were giving bogus buffer alignment limits to the applicatio

Re: [Mesa-dev] [PATCH] anv: Fix uniform and storage buffer offset alignment limits.

2016-12-16 Thread Francisco Jerez
Jason Ekstrand writes: > On Dec 15, 2016 3:22 PM, "Francisco Jerez" wrote: > > This fixes an apparent regression in a bunch of image store vulkan CTS > tests from commit ad38ba113491869ab0dffed937f7b3dd50e8a735, which > started using OWORD block read messages to

Re: [Mesa-dev] [RFC PATCH] clover: Return correct CL_EVENT_REFERENCE_COUNT

2016-12-16 Thread Francisco Jerez
Vedran Miletić writes: > Current implementation of event handling keeps an extra reference to > the hardware event, in addition to the reference returned via the OpenCL > API. This additional reference is internal and should not be counted > when queried via the clGetEventInfo() function. > > Fix

Re: [Mesa-dev] [PATCH v2 043/103] i965/vec4: handle 32 and 64 bit channels in liveness analysis

2016-12-19 Thread Francisco Jerez
Iago Toral Quiroga writes: > From: "Juan A. Suarez Romero" > > Our current data flow analysis does not take into account that channels > on 64-bit operands are 64-bit. This is a problem when the same register > is accessed using both 64-bit and 32-bit channels. This is very common > in operation

Re: [Mesa-dev] [PATCH v2 043/103] i965/vec4: handle 32 and 64 bit channels in liveness analysis

2016-12-20 Thread Francisco Jerez
"Juan A. Suarez Romero" writes: > On Mon, 2016-12-19 at 13:58 -0800, Francisco Jerez wrote: >> Iago Toral Quiroga writes: >> >> > From: "Juan A. Suarez Romero" >> > >> > Our current data flow analysis does not take into account th

Re: [Mesa-dev] [PATCH] clover: Use Clang's diagnostics

2016-12-20 Thread Francisco Jerez
space { > const std::vector &opts, > std::string &r_log) { >std::unique_ptr c { new > clang::CompilerInstance }; > + clang::TextDiagnosticBuffer* diag_buffer = new > clang::TextDiagnosticBuffer; Inconsistent pointer formatting.

Re: [Mesa-dev] [PATCH v2 2/4] clover: Pass work_dim parameter of clEnqueueNDRangeKernel() to driver

2016-06-29 Thread Francisco Jerez
Ilia Mirkin writes: > On Wed, Jun 29, 2016 at 2:42 PM, Jan Vesely wrote: >> On Wed, 2016-06-29 at 14:37 +0200, Hans de Goede wrote: >>> In order to implement get_work_dim() the driver may need to know the >>> clEnqueueNDRangeKernel() work_dim parameter, so pass it to the >>> driver. >> >> The wo

Re: [Mesa-dev] [PATCH v2] i965: intel_texture_barrier reimplemented

2016-06-29 Thread Francisco Jerez
Hi Alejandro, Alejandro Piñeiro writes: > Fixes: > GL44-CTS.texture_barrier_ARB.same-texel-rw-multipass > > On Haswell, Broadwell and Skylake (note that in order to execute that > test, it is needed to override GL and GLSL versions). > > On gen6 this test was already working without this change.

Re: [Mesa-dev] [PATCH v3] i965: intel_texture_barrier reimplemented

2016-06-30 Thread Francisco Jerez
); > + } > + > + brw_emit_pipe_control_flush(brw, > + PIPE_CONTROL_DEPTH_CACHE_FLUSH | > + PIPE_CONTROL_RENDER_TARGET_FLUSH | > + PIPE_CONTROL_CS_STALL); > + > + brw_emi

Re: [Mesa-dev] [PATCH 15/24] i965: Use LZD to implement nir_op_ufind_msb

2016-06-30 Thread Francisco Jerez
Matt Turner writes: > On Wed, Jun 29, 2016 at 2:04 PM, Ian Romanick wrote: >> From: Ian Romanick >> >> This uses one less instruction. > > Add FBH to the list of stupid instructions. > >> Signed-off-by: Ian Romanick >> --- >> src/mesa/drivers/dri/i965/brw_fs.h | 4 >> src/

Re: [Mesa-dev] [PATCH 18/24] i965: Update assertion to account for Gen < 7

2016-06-30 Thread Francisco Jerez
Ian Romanick writes: > From: Ian Romanick > > Previously SHADER_OPCODE_MULH could only exist on Gen7+, so the > assertion assumed the Gen7+ accumulator rules. A future patch will > allow this instruction on at least Gen6, so update the assertion. > > Signed-off-by: Ian Romanick > --- > src/me

Re: [Mesa-dev] [PATCH 15/24] i965: Use LZD to implement nir_op_ufind_msb

2016-06-30 Thread Francisco Jerez
Ian Romanick writes: > On 06/30/2016 03:33 PM, Francisco Jerez wrote: >> Matt Turner writes: >> >>> On Wed, Jun 29, 2016 at 2:04 PM, Ian Romanick wrote: >>>> From: Ian Romanick >>>> >>>> This uses one less instruction. >>>

Re: [Mesa-dev] [PATCH 16/24] i965: Use LZD to implement nir_op_ifind_msb on Gen < 7

2016-06-30 Thread Francisco Jerez
Ian Romanick writes: > From: Ian Romanick > > Signed-off-by: Ian Romanick > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 50 ++-- > src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 52 > +++--- > 2 files changed, 81 insertions(+), 21 deletions

Re: [Mesa-dev] [PATCH v3] i965: intel_texture_barrier reimplemented

2016-06-30 Thread Francisco Jerez
Jason Ekstrand writes: > Fwiw, I very much like the way I did this in the Vulkan driver where it > splits it into two pipe controls automatically based on the input bits. > (Look at genX_cmd_buffer.c cmd_buffer_apply_pipe_flushes.) I very much > doubt that this is the only place we have this pro

Re: [Mesa-dev] [PATCH v3] i965: intel_texture_barrier reimplemented

2016-06-30 Thread Francisco Jerez
Jason Ekstrand writes: > On Jun 30, 2016 9:25 PM, "Francisco Jerez" wrote: >> >> Jason Ekstrand writes: >> >> > Fwiw, I very much like the way I did this in the Vulkan driver where it >> > splits it into two pipe controls automatically based o

[Mesa-dev] [PATCH 4/4] i965: Fix remaining flush vs invalidate race conditions in brw_emit_pipe_control_flush.

2016-06-30 Thread Francisco Jerez
This hardware race condition has caused problems several times already (see "i965: Fix cache pollution race during L3 partitioning set-up.", "i965: Fix brw_render_cache_set_check_flush's PIPE_CONTROLs." and "i965: intel_texture_barrier reimplemented"). The problem is that whenever we attempt to bo

[Mesa-dev] [PATCH 2/4] i965: Emit SKL VF cache invalidation W/A from brw_emit_pipe_control_flush.

2016-06-30 Thread Francisco Jerez
There were two places in the driver doing a pipe control VF cache flush, one of them was missing this workaround, move it down into brw_emit_pipe_control_flush to make sure we don't miss it again. --- src/mesa/drivers/dri/i965/brw_pipe_control.c | 19 ++- 1 file changed, 10 inserti

[Mesa-dev] [PATCH 3/4] i965: Make room in the batch epilogue for three more pipe controls.

2016-06-30 Thread Francisco Jerez
Review carefully, it sucks to have to keep track of the number of command packet dwords emitted in the batch epilogue manually. The MI_REPORT_PERF_COUNT_BATCH_DWORDS calculation was obviously wrong. --- src/mesa/drivers/dri/i965/brw_performance_monitor.c | 10 +- src/mesa/drivers/dri/i965

[Mesa-dev] [PATCH 1/4] i965: Emit SNB write cache flush W/A from brw_emit_pipe_control_flush.

2016-06-30 Thread Francisco Jerez
Shouldn't cause any functional changes at this point, but we have forgotten to apply this workaround several times in the past, make sure it doesn't happen again. --- src/mesa/drivers/dri/i965/brw_misc_state.c | 9 - src/mesa/drivers/dri/i965/brw_pipe_control.c | 21 +++-

Re: [Mesa-dev] [PATCH 4/4] i965: Fix remaining flush vs invalidate race conditions in brw_emit_pipe_control_flush.

2016-07-01 Thread Francisco Jerez
n some places though it's really convenient to be able to put all cache bits for which coherency is required into a single bitfield and have brw_emit_pipe_control_flush() figure out whether the command needs to be split (e.g. brw_memory_barrier()). > --Jason > > On Thu, Jun 30, 2016 at 1

[Mesa-dev] clover: Implement linking of multiple CL programs.

2016-07-03 Thread Francisco Jerez
This series is the result of a long back and forth of patches between Serge and me. Most of the changes are already reviewed by either of us, but I'm sending them again over the mailing list just in case somebody else wants to give additional feedback. Patches 1-30 are mainly cleaning up and rewo

[Mesa-dev] [PATCH 02/47] clover/llvm: Drop support for LLVM < 3.6.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 40 +++--- 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 44c7e1e

[Mesa-dev] [PATCH 07/47] clover/llvm: Refactor compiler instance initialization.

2016-07-03 Thread Francisco Jerez
This will be shared between the compiler and linker codepaths. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 99 ++ 1 file changed, 47 insertions(+), 52 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/sr

[Mesa-dev] [PATCH 03/47] clover/llvm: Drop dead code.

2016-07-03 Thread Francisco Jerez
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 Mar

[Mesa-dev] [PATCH 10/47] clover/llvm: Clean up compilation into LLVM IR.

2016-07-03 Thread Francisco Jerez
Some assorted and mostly trivial clean-ups for the source to bitcode compilation path. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 52 +- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/src/gallium/state_trackers/clover/l

[Mesa-dev] [PATCH 19/47] clover/llvm: Fold compile_native() call into build_module_native().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 242c096..754e477

[Mesa-dev] [PATCH 17/47] clover/llvm: Clean up compile_native().

2016-07-03 Thread Francisco Jerez
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: Upda

[Mesa-dev] [PATCH 04/47] clover/llvm: Collect #ifdef mess into a separate file.

2016-07-03 Thread Francisco Jerez
1,116 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the righ

[Mesa-dev] [PATCH 24/47] clover/llvm: Clean up bitcode codegen.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 36 -- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 21e6e0

[Mesa-dev] [PATCH 26/47] clover/llvm: Define function for bitcode print-out.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index d4c8add..

[Mesa-dev] [PATCH 45/47] clover: Trivial cleanups for api/program.cpp.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index 2dc9ee7..1836099 10064

[Mesa-dev] [PATCH 20/47] clover/llvm: Clean up codestyle of get_kernel_args().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 223 ++--- 1 file changed, 103 insertions(+), 120 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 754e

[Mesa-dev] [PATCH 31/47] clover/llvm: Implement library bitcode codegen.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/codegen.hpp | 7 ++ .../state_trackers/clover/llvm/codegen/bitcode.cpp | 25 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/clover/llvm/codegen.hpp b/src/ga

[Mesa-dev] [PATCH 18/47] clover/llvm: Factor out duplicated construction of clover::module.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 88 ++ 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 1e4bed

[Mesa-dev] [PATCH 41/47] clover: Unify program::build_* into a single method returning a struct.

2016-07-03 Thread Francisco Jerez
This gets rid of the program::build_* query methods and replaces them with the program::build() method that returns a single data structure containing all parameters for the last build done on the given target device (including build logs, options and the binary itself). [ Serge Martin: Fix invert

[Mesa-dev] [PATCH 21/47] clover/llvm: Add simplified utility functions for metadata introspection.

2016-07-03 Thread Francisco Jerez
/state_trackers/clover/llvm/metadata.hpp @@ -0,0 +1,132 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without r

[Mesa-dev] [PATCH 42/47] clover: Provide separate program methods for compilation and linking.

2016-07-03 Thread Francisco Jerez
[ Serge Martin: Fix inverted opts and log build ctor args. Keep the log related to the build. Fix indentation ] Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 8 +++-- src/gallium/state_trackers/clover/core/program.cpp | 34 ++ src/galli

[Mesa-dev] [PATCH 30/47] clover/llvm: Trivial assorted cleanups for invocation.cpp.

2016-07-03 Thread Francisco Jerez
Drop a few include and using directives which are no longer necessary. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 57 +++--- 1 file changed, 7 insertions(+), 50 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cp

[Mesa-dev] [PATCH 16/47] clover/llvm: Clean up ELF parsing.

2016-07-03 Thread Francisco Jerez
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

[Mesa-dev] [PATCH 44/47] clover/core: Remove compiler.hpp.

2016-07-03 Thread Francisco Jerez
/gallium/state_trackers/clover/core/compiler.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Copyright 2012 Francisco Jerez -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to d

[Mesa-dev] [PATCH 09/47] clover/llvm: Factor out LLVM context init.

2016-07-03 Thread Francisco Jerez
So it can be shared between the compilation and linking codepaths. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 83 +++--- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp

[Mesa-dev] [PATCH 39/47] clover: Define error subclass to signal build option parse failure.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 6 -- src/gallium/state_trackers/clover/core/error.hpp | 6 ++ src/gallium/state_trackers/clover/llvm/invocation.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/galli

[Mesa-dev] [PATCH 34/47] clover/llvm: Implement the -create-library linker option.

2016-07-03 Thread Francisco Jerez
[ Serge Martin: disable internalize pass when building a library. Otherwise some functions may be inlined and removed ] Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 47 +++--- .../state_trackers/clover/util/functional.hpp | 21

[Mesa-dev] [PATCH 25/47] clover/llvm: Split native codegen and assembly print-out into separate functions.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 38 -- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index f0f1b7

[Mesa-dev] [PATCH 28/47] clover/llvm: Split bitcode codegen into separate file.

2016-07-03 Thread Francisco Jerez
aa07 --- /dev/null +++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp @@ -0,0 +1,76 @@ +// +// Copyright 2012-2016 Francisco Jerez +// Copyright 2012-2016 Advanced Micro Devices, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this

[Mesa-dev] [PATCH 01/47] clover: Bump required LLVM version to 3.6.

2016-07-03 Thread Francisco Jerez
From: Serge Martin Reviewed-by: Francisco Jerez --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8321e8e..c5e1d55 100644 --- a/configure.ac +++ b/configure.ac @@ -2182,7 +2182,7 @@ if test "x$enable_gallium_llvm&qu

[Mesa-dev] [PATCH 14/47] clover/llvm: Tidy debug handling.

2016-07-03 Thread Francisco Jerez
Most significant change is debugging flags are now a scoped enum and all debugging helpers live in the debug namespace. Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 81 +++--- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/sr

[Mesa-dev] [PATCH 38/47] clover: Move back to using build_error to signal compilation failure.

2016-07-03 Thread Francisco Jerez
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 exce

[Mesa-dev] [PATCH 46/47] clover: Add clLinkProgram (CL 1.2).

2016-07-03 Thread Francisco Jerez
From: Serge Martin [ Francisco Jerez: Use validate_build_common for error checking, simplify control flow slightly and handle additional exception types. ] Reviewed-by: Francisco Jerez --- src/gallium/state_trackers/clover/api/program.cpp | 31 --- 1 file changed, 27

[Mesa-dev] [PATCH 12/47] clover/llvm: Simplify diagnostic_handler().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/invocation.cpp | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 2ca57d0..962f

[Mesa-dev] [PATCH 08/47] clover/llvm: Declare compiler instance at top level and pass down as argument.

2016-07-03 Thread Francisco Jerez
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: Se

[Mesa-dev] [PATCH 35/47] clover/tgsi: Move compiler entry point declaration into tgsi directory and namespace.

2016-07-03 Thread Francisco Jerez
ff --git a/src/gallium/state_trackers/clover/tgsi/invocation.hpp b/src/gallium/state_trackers/clover/tgsi/invocation.hpp new file mode 100644 index 000..0fa20c4 --- /dev/null +++ b/src/gallium/state_trackers/clover/tgsi/invocation.hpp @@ -0,0 +1,35 @@ +// +// Copyright 2016 Francisco Jerez +//

[Mesa-dev] [PATCH 05/47] clover/llvm: Factor out target string parsing.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 45 -- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 2f5c8a

[Mesa-dev] [PATCH 40/47] clover: Change program::build opts argument to std::string.

2016-07-03 Thread Francisco Jerez
From: Serge Martin Reviewed-by: Francisco Jerez --- src/gallium/state_trackers/clover/core/program.cpp | 4 ++-- src/gallium/state_trackers/clover/core/program.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src

[Mesa-dev] [PATCH 29/47] clover/llvm: Split native codegen into separate file.

2016-07-03 Thread Francisco Jerez
degen/native.cpp new file mode 100644 index 000..4adb05f --- /dev/null +++ b/src/gallium/state_trackers/clover/llvm/codegen/native.cpp @@ -0,0 +1,165 @@ +// +// Copyright 2012-2016 Francisco Jerez +// Copyright 2012-2016 Advanced Micro Devices, Inc. +// +// Permission is hereby granted, free of cha

[Mesa-dev] [PATCH 13/47] clover/llvm: Use helper function to abort compilation with error message.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 56 +++--- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 962f1b

[Mesa-dev] [PATCH 47/47] clover/api: Implement clLinkProgram per-device binary presence validation rule.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/api/program.cpp | 33 +-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index 0303c1e..c3f9cb

[Mesa-dev] [PATCH 32/47] clover/llvm: Split compilation and linking.

2016-07-03 Thread Francisco Jerez
_program(source, headers, target, opts, r_log); + return link_program({ mod }, ir, target, opts, r_log); +} diff --git a/src/gallium/state_trackers/clover/llvm/invocation.hpp b/src/gallium/state_trackers/clover/llvm/invocation.hpp new file mode 100644 index 000..9e90c50 --- /dev/null +++ b/src/galliu

[Mesa-dev] [PATCH 11/47] clover/llvm: Trivial codestyle clean-up for optimize().

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 26 +++--- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index e9b3db

[Mesa-dev] [PATCH 15/47] clover/llvm: Move a bunch of utility functions into separate file.

2016-07-03 Thread Francisco Jerez
- else -std::ofstream(path + suffix, std::ios::app) << s; - } - } - void init_targets() { static bool targets_initialized = false; diff --git a/src/gallium/state_trackers/clover/llvm/util.hpp b/src/gallium/state_trackers/clover/llvm/util.hpp new file mode 10

[Mesa-dev] [PATCH 36/47] clover/tgsi: Add stub link_program() function.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/tgsi/compiler.cpp | 7 +++ src/gallium/state_trackers/clover/tgsi/invocation.hpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/gallium/state_trackers/clover/tgsi/compiler.cpp b/src/gallium/state_trackers/clover/tg

[Mesa-dev] [PATCH 27/47] clover/llvm: Split shared codegen support code into separate file.

2016-07-03 Thread Francisco Jerez
/src/gallium/state_trackers/clover/llvm/codegen.hpp new file mode 100644 index 000..23f3b17 --- /dev/null +++ b/src/gallium/state_trackers/clover/llvm/codegen.hpp @@ -0,0 +1,48 @@ +// +// Copyright 2016 Francisco Jerez +// +// Permission is hereby granted, free of charge, to any person obtaining

[Mesa-dev] [PATCH 06/47] clover/llvm: Factor out compiler option tokenization.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 25 +++--- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 7cfd44

[Mesa-dev] [PATCH 33/47] clover/llvm: Implement linkage of multiple clover modules.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- src/gallium/state_trackers/clover/llvm/compat.hpp | 19 +++ src/gallium/state_trackers/clover/llvm/invocation.cpp | 19 --- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/comp

[Mesa-dev] [PATCH 22/47] clover/llvm: Use metadata introspection utils for kernel argument set-up.

2016-07-03 Thread Francisco Jerez
Reviewed-by: Serge Martin --- .../state_trackers/clover/llvm/invocation.cpp | 97 ++ 1 file changed, 5 insertions(+), 92 deletions(-) diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 0fc6190

<    4   5   6   7   8   9   10   11   12   13   >