[hsa,testsuite] Introduce offload_device_shared_as effective target

2016-02-26 Thread Martin Jambor
on a device with shared memory (this includes the host). Keith included a C++ test to illustrate the use. I have tested this thoroughly, both with and without HSA (enabled or present). OK for trunk? Thanks, Martin 2016-02-10 Keith McDaniel <k.allen.mcdan...@gmail.com> Martin

[hsa, testsuite] Gridification tests

2016-02-26 Thread Martin Jambor
that gridification happens. Tested, both with and without HSA enabled. OK for trunk? Thanks, Martin 2016-02-10 Martin Jambor <mjam...@suse.cz> * target-supports.exp (check_effective_target_offload_hsa): New. * c-c++-common/gomp/gridify-1.c: New test. * gfortran.dg/gomp/g

[hsa/69568] Fix ld instruction type for packed data

2016-02-26 Thread Martin Jambor
). The patch below fulfills that requirement. I have bootstrapped and tested it and will commit it shortly. Thanks, Martin 2016-02-18 Martin Jambor <mjam...@suse.cz> PR hsa/69568 * hsa.h (hsa_type_packed_p): Declare. * hsa.c (hsa_type_packed_p): New function.

[hsa/69674] Make testsuite libgomp.c/for-3.c compile with -m32

2016-02-26 Thread Martin Jambor
not build libgomp plugin for it, but we should not ICE and the new code below is the correct way of doing things anyway. So I will commit it shortly, it has been included in a bootstrap/testsuite run. Thanks, Martin 2016-02-18 Martin Jambor <mjam...@suse.cz> pr hsa/69674 * hsa

[hsa] Satisfy conditional move operand type constrains

2016-02-26 Thread Martin Jambor
, Martin 2016-02-17 Martin Jambor <mjam...@suse.cz> * hsa.h (is_a_helper): New overload for hsa_op_immed for hsa_op_with_type operands. (hsa_unsigned_type_for_type): Declare. * hsa.c (hsa_unsigned_type_for_type): New function. * hsa

[hsa] Fail in presence of atomic operations in private segment

2016-02-26 Thread Martin Jambor
in the compiler, because otherwise there is testcase in the libgomp testsuite that complains about the finalizer errors in the output of the execute test. Bootstrapped and tested, I'll commit it to trunk shortly. Thanks, Martin 2016-02-17 Martin Jambor <mjam...@suse.cz> * hsa

[omp, hsa] Do not gridify simd constructs

2016-02-26 Thread Martin Jambor
the body even though the explicit loop is missing, but that will also mean that the HSA grid size has to shrink appropriately. Bootstrapped and tested on x86_64-linux, with and without HSA enabled. OK for trunk? Thanks, Martin 2016-02-17 Martin Jambor <mjam...@suse.cz> * omp

Re: [PATCH 1/4] Replace ENABLE_CHECKING macro with flag_checking in HSA

2016-02-25 Thread Martin Jambor
On Wed, Feb 24, 2016 at 02:59:11PM +0100, Martin Liska wrote: > gcc/ChangeLog: > > 2016-02-24 Martin Liska > > * hsa-gen.c (generate_hsa): Replace ENABLE_CHECKING macro > with flag_checking. > * hsa-regalloc.c (linear_scan_regalloc): Likewise. OK, thanks,

Re: [pr 69666] No SRA default_def replacements for unscalarizable

2016-02-24 Thread Martin Jambor
On Tue, Feb 23, 2016 at 06:45:08AM -0800, H.J. Lu wrote: > On Fri, Feb 19, 2016 at 8:21 AM, Martin Jambor <mjam...@suse.cz> wrote: > > Hi, > > > > in PR 69666, SRA attempts to turn a load from an aggregate that is > > uninitialized into a load from a d

[pr 69666] No SRA default_def replacements for unscalarizable

2016-02-19 Thread Martin Jambor
. Bootstrapped and tested on x86_64, OK for trunk and later for the 5 branch? Thanks, Martin 2016-02-19 Martin Jambor <mjam...@suse.cz> PR tree-optimization/69666 * tree-sra.c (sra_modify_assign): Do not attempt to create defaut_def replacements for unscalarizable r

Re: [PATCH] Add debug_function_graph_to_file

2016-02-18 Thread Martin Jambor
On Wed, Feb 17, 2016 at 03:00:00PM +0100, Richard Biener wrote: > On Wed, Feb 17, 2016 at 2:51 PM, Marek Polacek wrote: > > On Wed, Feb 17, 2016 at 02:45:36PM +0100, Richard Biener wrote: > >> OTOH I have in my local trees a more convenient form (attached). > >> > >> (gdb)

Re: [hsa merge 00/10] Merge of HSA branch

2016-02-02 Thread Martin Jambor
@@ News + Heterogeneous Systems Architecture support + [2016-01-27] + http://www.hsafoundation.com/;> Heterogeneous Systems + Architecture 1.0 https://gcc.gnu.org/gcc-6/changes.html#hsa;> + support was added to GCC, contributed by Martin Jambor, Martin Liška + and Michael Matz from S

[hsa branch] Map collapse(2) and collapse(3) to HSA grid dimensions

2016-02-02 Thread Martin Jambor
are small because as I was restructuring the code, I was moving it in this direction for some time already. Committed to the branch (a few days ago actually, sorry for that). Thanks, Martin 2016-01-26 Martin Jambor <mjam...@suse.cz> gcc/ * Makefile.in (BUILTINS_DEF): A

[hsa] Atomic assess memory model fixes

2016-01-29 Thread Martin Jambor
it trunk even at this stage, even though of course nothing in HSA is a regression. Thanks, Martin 2016-01-29 Martin Jambor <mjam...@suse.cz> * hsa-gen.c (get_memory_order_name): Mask with MEMMODEL_BASE_MASK. Use short lowercase names. (get_memory_order)

Re: Martin Jambor appointed HSA Maintainer

2016-01-29 Thread Martin Jambor
Hi, On Fri, Dec 18, 2015 at 08:41:41AM -0500, David Edelsohn wrote: > I am pleased to announce that the GCC Steering Committee has > appointed Martin Jambor as HSA maintainer. > > Please join me in congratulating Martin on his new role. > Martin, please upda

Re: [hsa merge 00/10] Merge of HSA branch

2016-01-27 Thread Martin Jambor
ous Systems Architecture support in GCC + [2016-01-27] + http://www.hsafoundation.com/;> Heterogeneous Systems + Architecture 1.0 https://gcc.gnu.org/gcc-6/changes.html#hsa;> + support was added to GCC. Contributed by Martin Jambor, Martin Liška + and Michael Matz from SUSE. +

[PR 69355] Correct hole detection when total_scalarization fails

2016-01-26 Thread Martin Jambor
as unscalarized data). Bootstrapped and tested on x86_64-linux. OK for trunk? And the gcc-5 branch? Thanks, Martin 2016-01-26 Martin Jambor <mjam...@suse.cz> PR tree-optimization/69355 * tree-sra.c (analyze_access_subtree): Correct hole detection when total_scalari

Re: [gomp4] Un-parallelized OpenACC kernels constructs with nvptx offloading: "avoid offloading"

2016-01-26 Thread Martin Jambor
On Fri, Jan 22, 2016 at 02:18:38PM +0100, Bernd Schmidt wrote: > On 01/22/2016 09:36 AM, Jakub Jelinek wrote: > > > >I think it is a bad idea to go against what the user wrote. Warning that > >some code might not be efficient? Perhaps (if properly guarded with some > >warning option one can turn

Re: [hsa merge 00/10] Merge of HSA branch

2016-01-19 Thread Martin Jambor
Hi, On Wed, Jan 13, 2016 at 06:39:25PM +0100, Martin Jambor wrote: > Hi, > > this is hopefully the last big re-post of the HSA patches... I have committed the combined patch as revision 232549 after bootstrapping and testing all languages on x86_64-linux and i686-linux and verify

Re: [hsa merge 08/10] HSAIL BRIG description header file

2016-01-18 Thread Martin Jambor
Hi, On Sat, Jan 16, 2016 at 12:43:07PM +0100, Jakub Jelinek wrote: > On Fri, Jan 15, 2016 at 06:23:05PM +0100, Martin Jambor wrote: > > BRIG_KIND_OPERAND_REGISTER = 0x300a, > > BRIG_KIND_OPERAND_STRING = 0x300b, > > BRIG_KIND_OPERAND_WAVESIZE = 0x3009c, > > BRI

Re: [hsa merge 09/10] Majority of the HSA back-end

2016-01-18 Thread Martin Jambor
Hi, On Sat, Jan 16, 2016 at 09:58:51AM +0100, Jakub Jelinek wrote: > On Sat, Jan 16, 2016 at 12:49:12AM +0100, Martin Jambor wrote: > > bootstrapping on i686-linux revealed the need for the following simple > > patch. I've run into two types of compilation errors on >

Re: [hsa merge 08/10] HSAIL BRIG description header file

2016-01-15 Thread Martin Jambor
Hi, On Thu, Jan 14, 2016 at 05:18:56PM -0800, Ian Lance Taylor wrote: > Jakub Jelinek <ja...@redhat.com> writes: > > > On Wed, Jan 13, 2016 at 06:39:33PM +0100, Martin Jambor wrote: > >> the following patch adds a BRIG (binary representation of HSAIL) >

Re: [hsa merge 10/10] HSA register allocator

2016-01-15 Thread Martin Jambor
Hi, On Thu, Jan 14, 2016 at 03:41:34PM +0100, Jakub Jelinek wrote: > On Wed, Jan 13, 2016 at 06:39:35PM +0100, Martin Jambor wrote: > > +for (phi = hbb->m_first_phi; > > +phi; > > +phi = phi->m_next ? as_a (phi->m_next): NULL) > > Space before :

Re: [hsa merge 05/10] OpenMP lowering/expansion changes (gridification)

2016-01-15 Thread Martin Jambor
Thanks Jakub and Alex, I have committed the following to the branch to address your comments: 2016-01-15 Martin Jambor <mjam...@suse.cz> * gimple.h: Fixed comment of gimple_statement_omp_single_layout * omp-low.c (get_target_argument_value): Fixed spelling

Re: [hsa merge 07/10] IPA-HSA pass

2016-01-15 Thread Martin Jambor
On Thu, Jan 14, 2016 at 01:58:58PM +0100, Jakub Jelinek wrote: > Otherwise LGTM. > > Jakub Thanks Jakub, I have committed the following patch from Martin Liska that addresses your comments. Martin 2016-01-15 Martin Liska * ipa-hsa.c (process_hsa_functions):

Re: [hsa merge 09/10] Majority of the HSA back-end

2016-01-15 Thread Martin Jambor
et me just quickly answer two comments as well: On Thu, Jan 14, 2016 at 03:05:33PM +0100, Jakub Jelinek wrote: > On Wed, Jan 13, 2016 at 06:39:34PM +0100, Martin Jambor wrote: > ... > > +#define HSA_WARN_MEMORY_ROUTINE "OpenMP device memory library routines > > have " \ >

Re: [hsa merge 08/10] HSAIL BRIG description header file

2016-01-15 Thread Martin Jambor
On Fri, Jan 15, 2016 at 01:03:35PM +0100, Jakub Jelinek wrote: > On Fri, Jan 15, 2016 at 11:37:32AM +0100, Jakub Jelinek wrote: > > On Fri, Jan 15, 2016 at 11:14:33AM +0100, Martin Jambor wrote: > > > > Martin, could you ask the HSA Foundation or AMD or whoever if the

Re: [hsa merge 07/10] IPA-HSA pass

2016-01-15 Thread Martin Jambor
Hi, On Fri, Jan 15, 2016 at 04:01:49PM +0100, Jakub Jelinek wrote: > On Fri, Jan 15, 2016 at 03:53:23PM +0100, Martin Jambor wrote: > > @@ -317,7 +319,7 @@ public: > > bool > > pass_ipa_hsa::gate (function *) > > { > > - return hsa_gen_requeste

Re: [hsa merge 09/10] Majority of the HSA back-end

2016-01-15 Thread Martin Jambor
by making most of the contents of hsa-*.c files compiled only conditionally (and leave potential hsa support on non-linux platforms for later), but I will not have time to do the change and test it properly until Monday. But that will hopefully really be it, Martin 2016-01-16 Martin Jambor

[hsa merge 08/10] HSAIL BRIG description header file

2016-01-13 Thread Martin Jambor
jections against HSA going forward, including this file. Thanks, Martin 2015-12-04 Martin Jambor <mjam...@suse.cz> * hsa-brig-format.h: New file. diff --git a/gcc/hsa-brig-format.h b/gcc/hsa-brig-format.h new file mode 100644 index 000..6e2fe75 --- /dev/null +++ b/gcc/hsa-bri

[hsa merge 05/10] OpenMP lowering/expansion changes (gridification)

2016-01-13 Thread Martin Jambor
all of which has been posted in https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01884.html. Thanks, Martin 2016-01-13 Martin Jambor <mjam...@suse.cz> gcc/ * builtin-types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New. (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): R

[hsa merge 01/10] Configury changes and new options

2016-01-13 Thread Martin Jambor
/gcc-patches/2015-12/msg01284.html). thanks, Martin 2016-01-13 Martin Jambor <mjam...@suse.cz> * Makefile.in (OBJS): Add new source files. (GTFILES): Add hsa.c. * common.opt (disable_hsa): New variable. (-Whsa): New warning. * config.in (ENABLE_HSA

[hsa merge 00/10] Merge of HSA branch

2016-01-13 Thread Martin Jambor
Hi, this is hopefully the last big re-post of the HSA patches. We have incorporated all the feedback and found and fixed a couple more bugs. The complete patch-set bootstraps and tests fine on an x86_64-linux, when you do not enable HSA, there are a few expected warnings when HSA is enabled

[hsa merge 06/10] Pass manager changes

2016-01-13 Thread Martin Jambor
Hi, the pass manager changes required for HSA have already been committed to trunk so all that remains are these additions to the pass pipeline. This bit has already been approved by Richi in https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00996.html Thanks, Martin 2016-01-13 Martin Jambor

[hsa merge 10/10] HSA register allocator

2016-01-13 Thread Martin Jambor
2016-01-13 Michael Matz <m...@suse.de> Martin Jambor <mjam...@suse.cz> * hsa-regalloc.c: New file. diff --git a/gcc/hsa-regalloc.c b/gcc/hsa-regalloc.c new file mode 100644 index 000..5a42beb --- /dev/null +++ b/gcc/hsa-regalloc.c @@ -0,0 +1,719 @@ +/* HSAIL

[hsa merge 04/10] Avoid extraneous remapping in copy_gimple_seq_and_replace_locals

2016-01-13 Thread Martin Jambor
-inline.h as I think that such a cleanup should be done separately, but the structure could probably use some field-re ordering to remove padding. I hope I have grasped it correctly and that the patch is OK for trunk. Thanks, Martin 2016-01-13 Martin Jambor <mjam...@suse.cz>

[hsa merge 03/10] HSA libgomp plugin

2016-01-13 Thread Martin Jambor
-12/msg00716.html with a number of modifications requested by Jakub. Thanks, Martin 2016-01-13 Martin Jambor <mjam...@suse.cz> Martin Liska <mli...@suse.cz> * plugin/plugin-hsa.c: New file. diff --git a/libgomp/plugin/plugin-hsa.c b/libgomp/plugin/plugin-hs

[hsa merge 02/10] Modifications to libgomp proper

2016-01-13 Thread Martin Jambor
communications with Jakub, I have the feeling he is fine with the changes. But perhaps he or someone else would like to have one more look. Thanks, Martin 2016-01-13 Martin Jambor <mjam...@suse.cz> include/ * gomp-constants.h (GOMP_DEVICE_HSA): New macro. (GOMP_VERSION_HSA): Li

[hsa merge 07/10] IPA-HSA pass

2016-01-13 Thread Martin Jambor
e same LTO partition so that they can b registered together to libgomp. Thanks, Martin 2016-01-13 Martin Liska <mli...@suse.cz> Martin Jambor <mjam...@suse.cz> * ipa-hsa.c: New file. * lto-section-in.c (lto_section_name): Add hsa section name.

Re: [hsa 2/10] Modifications to libgomp proper

2016-01-12 Thread Martin Jambor
Hi, On Fri, Dec 11, 2015 at 07:05:29PM +0100, Jakub Jelinek wrote: > On Thu, Dec 10, 2015 at 06:52:23PM +0100, Martin Jambor wrote: > > > > --- a/libgomp/task.c > > > > +++ b/libgomp/task.c > > > > @@ -581,6 +581,7 @@ GOMP_PL

Re: [patch] Avoid an unwanted decl re-map in copy_gimple_seq_and_replace_locals

2016-01-12 Thread Martin Jambor
On Tue, Jan 12, 2016 at 06:36:21PM +0100, Martin Jambor wrote: > > remap_decl (old_var, id); > > } > > - phase 2 - do the full remap_decls, but during that arrange that > > remap_decl for non-zero id->remapping_type_depth if (!n) just returns > > decl

Re: [hsa 2/10] Modifications to libgomp proper

2016-01-12 Thread Martin Jambor
Hi, On Tue, Jan 12, 2016 at 02:38:15PM +0100, Jakub Jelinek wrote: > On Tue, Jan 12, 2016 at 02:29:06PM +0100, Martin Jambor wrote: > > GOMP_kernel_launch_attributes should not be there (it is a > > reminiscence from before the device-specific target arguments) and > >

Re: [patch] Avoid an unwanted decl re-map in copy_gimple_seq_and_replace_locals

2016-01-12 Thread Martin Jambor
Hi, On Mon, Jan 11, 2016 at 05:38:47PM +0100, Jakub Jelinek wrote: > On Mon, Jan 11, 2016 at 09:41:31AM +0100, Richard Biener wrote: > > Hum. Can't you check id->remapping_type_depth? For some reason, last week I reached the conclusion that no. But I must have done something wrong because I

[PR 69044] Do not clone for parameter removal when !can_change_signature

2016-01-08 Thread Martin Jambor
2016-01-08 Martin Jambor <mjam...@suse.cz> PR ipa/69044 * ipa-cp.c (estimate_local_effects): Do not clone for removal of useless parameters if we cannot change function signature. testsuite/ * gcc.target/i386/chkp-pr69044.c: New test. diff --git a/gcc/ipa-

[patch] Avoid an unwanted decl re-map in copy_gimple_seq_and_replace_locals

2016-01-08 Thread Martin Jambor
d any. If nobody has a better idea, is the following good for trunk? (I am about to commit it to the hsa branch.) It has passed bootstrap and testing on x86_64-linux. Thanks, Martin 2016-01-06 Martin Jambor <mjam...@suse.cz> * tree-inline.h (copy_body_data): New field

[PR ipa/66616] Fix artificial thunk ABI issues

2016-01-08 Thread Martin Jambor
passed bootstrap and testing on i686-linux, I have also included it in a bootstrap and testing that is underway on x86_64-linux. OK if it passes there as well? Thanks, Martin [PR ipa/66616] Copy can_change_signature flag to artificial thunks 2016-01-07 Martin Jambor <mjam...@suse

Re: [hsa 5/10] OpenMP lowering/expansion changes (gridification)

2015-12-18 Thread Martin Jambor
something for another patch. - "griddim" was changed to "_griddim_" at three places - I fixed formatting in all the suggested ways. Thanks, Martin 2015-12-16 Martin Jambor <mjam...@suse.cz> gcc/ * builtin-types.def: Removed a blank line.

Re: [PATCH 4/5] Fix intransitive comparison in compare_access_positions

2015-12-17 Thread Martin Jambor
Hi, On Thu, Dec 17, 2015 at 12:02:11PM +0300, Yury Gribov wrote: > Another intransitive comparison in reload_pseudo_compare_func. Buggy > scenario: > 1) A and B are ints of equal presion so we return 0 > 2) C is REAL and thus can compare differently to A and B > > Cc-ing Martin who's the

Re: ipa-cp heuristics fixes

2015-12-14 Thread Martin Jambor
Hi, On Fri, Dec 11, 2015 at 10:20:20PM +0100, Jan Hubicka wrote: > Actually I added > if (!ipa_is_param_used (info, i)) > > continue; > > shortcut to

[PR 68851] Do not collect thunks in callect_callers

2015-12-14 Thread Martin Jambor
into the vector in that method (which is only used by IPA-CP at this one spot and IPA-SRA so it should be fine). Bootstrapped and tested on x86_64-linux. OK for trunk? And perhaps for the gcc-5 branch too? Thanks, Martin 2015-12-14 Martin Jambor <mjam...@suse.cz> PR ipa/68851 * cg

[PR 68064] Testcase and an assert for an already fixed bug

2015-12-11 Thread Martin Jambor
a big difference for debugging). I have tossed this into a bootstrap and test run on an x86_64-linux and found no issues. I believe the patch is quite obvious and so will go ahead and commit it to trunk. Thanks, Martin Add asssert and testcase for PR 68064 2015-12-09 Martin Jambor <m

Re: ipa-cp heuristics fixes

2015-12-11 Thread Martin Jambor
On Thu, Dec 10, 2015 at 05:56:26PM +0100, Jan Hubicka wrote: > > Is this really necessary, is it not enough to remove the assignment to > > ret below? If the parameter is not used, devirtualization time bonus, > > which you then rely on estimate_local_effects, should be zero for it. > > > > It

[PR 66616] Check for thunks when adding extra constants to clones

2015-12-11 Thread Martin Jambor
Hi, PR 66616 happens because in find_more_scalar_values_for_callers_subset we do not do the same thunk checks like we do in propagate_constants_accross_call. I am in the process of bootstrapping and testing the following patch to fix it. OK if it passes? Thanks, Martin 2015-12-11 Martin

Re: [hsa 2/10] Modifications to libgomp proper

2015-12-10 Thread Martin Jambor
Hi, thanks for the feedback. I have incorporated most of it into the branch (the diff is below) but also have a few questions. On Wed, Dec 09, 2015 at 12:35:36PM +0100, Jakub Jelinek wrote: > On Mon, Dec 07, 2015 at 12:19:57PM +0100, Martin Jambor wrote: > > +/* Flag set when the s

Re: [hsa 0/10] Merge of HSA branch

2015-12-10 Thread Martin Jambor
Hi, On Mon, Dec 07, 2015 at 12:46:45PM +0100, Jakub Jelinek wrote: > On Mon, Dec 07, 2015 at 12:17:58PM +0100, Martin Jambor wrote: > > Because I have not been able to come up with any solution to failing > > libgomp/testsuite/libgomp.c++/target-2.C, I have disabled use of > >

Re: ipa-cp heuristics fixes

2015-12-10 Thread Martin Jambor
Hi, thanks for looking into this, I only have one question: On Thu, Dec 10, 2015 at 08:30:37AM +0100, Jan Hubicka wrote: > Martin, > while looking into the ipa-cp dumps for bzip and Firefox I noticed few issues. > First of all, ipcp_cloning_candidate_p calls > optimize_function_for_speed_p

Re: [hsa 1/10] Configury changes and new options

2015-12-10 Thread Martin Jambor
Hi, On Tue, Dec 08, 2015 at 10:43:15PM +, Richard Sandiford wrote: > [Sorry for the low-quality review, was just reading out of interest...] > > Martin Jambor <mjam...@suse.cz> writes: > > +If you configure GCC with HSA offloading but do not have the HSA > >

Re: [hsa 1/10] Configury changes and new options

2015-12-10 Thread Martin Jambor
Hi, On Mon, Dec 07, 2015 at 12:19:08PM +0100, Martin Jambor wrote: > Hi, > > this patch contains changes to the configuration mechanism and offload > bits, so that users can build compilers with HSA support. when writing up how to build an HSA-enabled GCC for the wiki page,

[hsa 1/10] Configury changes and new options

2015-12-07 Thread Martin Jambor
ed to make it a parameter rather than a switch to emphasize the fact it will go away and to possibly allow us select different levels of verbosity of the stores in the future). Any feedback is very appreciated, Martin 2015-12-04 Martin Jambor <mjam...@suse.cz> gcc/ * Makefile.in (OBJS)

[hsa 6/10] Pass manager changes

2015-12-07 Thread Martin Jambor
Hi, the pass manager changes required for HSA have already been committed to trunk so all that remains are these additions to the pass pipeline. Thanks, Martin 2015-12-04 Martin Jambor <mjam...@suse.cz> Martin Liska <mli...@suse.cz> * passes.d

[hsa 7/10] IPA-HSA pass

2015-12-07 Thread Martin Jambor
d together and remain in the same LTO partition so that they can b registered together to libgomp. Thanks, Martin 2015-12-04 Martin Liska <mli...@suse.cz> Martin Jambor <mjam...@suse.cz> * ipa-hsa.c: New file. * lto-section-in.c (lto_section_name)

[hsa 0/10] Merge of HSA branch

2015-12-07 Thread Martin Jambor
Hi, I'm sorry it took me more than a month to come up with another round of patches aiming at merging the HSA branch into the trunk. Keeping up-to date with the latest changes in the OpenMP 4.5 area was strenuous and we have discovered and fixed a few bugs as I intensified my testing efforts.

[hsa 5/10] OpenMP lowering/expansion changes (gridification)

2015-12-07 Thread Martin Jambor
nd yet only re-implement the bare necessary minimum of functionality that is already there. Any feedback is of course still very welcome. Thanks, Martin 2015-12-04 Martin Jambor <mjam...@suse.cz> * builtin-types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New. (BT_FN_VOID_INT_

[hsa 8/10] HSAIL BRIG description header file (and a steering committee request)

2015-12-07 Thread Martin Jambor
C steering committee for permission to add this file to GCC (and update it as HSA standard evolves). Please let me know if there is something more I need to do in this regard. Thanks, Martin 2015-12-04 Martin Jambor <mjam...@suse.cz> * hsa-brig-format.h: New file. diff --git a/gcc/hsa-br

[hsa 2/10] Modifications to libgomp proper

2015-12-07 Thread Martin Jambor
2015-12-04 Martin Jambor <mjam...@suse.cz> Martin Liska <mli...@suse.cz> include/ * gomp-constants.h (GOMP_DEVICE_HSA): New macro. (GOMP_VERSION_HSA): Likewise. (GOMP_TARGET_ARG_DEVICE_MASK): Likewise. (GOMP_TARGET_ARG_DEVICE_AL

[hsa 3/10] HSA libgomp plugin

2015-12-07 Thread Martin Jambor
a device-specific parameter and support for asynchronous execution. Any feedback will be greatly appreciated, Martin 2015-12-04 Martin Jambor <mjam...@suse.cz> Martin Liska <mli...@suse.cz> * plugin/plugin-hsa.c: New file. diff --git a/libgomp/plugin/plugin-hsa

[hsa 4/10] Merge of HSA branch

2015-12-07 Thread Martin Jambor
Subject: Make copy_gimple_seq_and_replace_locals copy seqs in omp clauses Hi, this is https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00477.html with the early return requested by Jakub. Please refer to that previous email for explanation why it is necessary. Thanks, 2015-12-03 Martin Jambor

[hsa 10/10] HSA register allocator

2015-12-07 Thread Martin Jambor
2015-12-04 Michael Matz <m...@suse.de> Martin Jambor <mjam...@suse.cz> * hsa-regalloc.c: New file. diff --git a/gcc/hsa-regalloc.c b/gcc/hsa-regalloc.c new file mode 100644 index 000..9db4c1d --- /dev/null +++ b/gcc/hsa-regalloc.c @@ -0,0 +1,719 @@ +/* HSAIL

[hsa] Useful checking assert in scan_omp_1_op

2015-12-03 Thread Martin Jambor
Hi, I have found that adding the following checking assert very useful when debugging omp lowering issues, so I have added it to the hsa branch. I hope that nobody will mind, but it of course is not an essential thing to have if someone does. Thanks, Martin 2015-12-03 Martin Jambor <m

[hsa] Make copy_gimple_seq_and_replace_locals copy seqs in omp clauses

2015-12-03 Thread Martin Jambor
e_seq_copy, walk_gimple_seq and other to be technically incorrect, that is what I have done in the patch below, which fixes my last ICEs and which I have already committed to the branch. Any feedback is of course very much appreciated, Martin 2015-12-03 Martin Jambor <mjam...@suse.cz>

[hsa] Use proper accesses to gimple_omp_for

2015-11-30 Thread Martin Jambor
Hi, when looking at the attempt_target_gridification function I realized I forgot to to replace some of the early code with proper gimple statement access function calls. This patch addresses that. Committed to the branch. Thanks, Martin 2015-11-30 Martin Jambor <mjam...@suse

[hsa] Describe grid with target clauses

2015-11-30 Thread Martin Jambor
the grid size and group size along that dimension (hence the new clause type has two parameters). Committed to the branch, I will be preparing a new diff against the trunk shortly. Thanks, Martin 2015-11-30 Martin Jambor <mjam...@suse.cz> * gimple.c (gimple_omp_target_init_dime

[hsa] Use gimplify_expr in gridification

2015-11-30 Thread Martin Jambor
. Fixed with this patch, where pop_gimplify_context does the right thing like at other places in omp-low.c. Committed to the branch. Thanks, Martin 2015-11-30 Martin Jambor <mjam...@suse.cz> * omp-low.c (attempt_target_gridification): Use gimplify_expr. --- gcc/omp-low.

[hsa] Fix static local variable name conflict

2015-11-25 Thread Martin Jambor
Hi, the patch below makes libgomp/testsuite/libgomp.c/target-28.c pass on HSA, where it previously did not like the two static variables with the same name. Committed to the branch. Thanks, Martin 2015-11-25 Martin Jambor <mjam...@suse.cz> * hsa.c (hsa_get_declaratio

Re: [hsa] depend nowait support for target

2015-11-25 Thread Martin Jambor
On Mon, Nov 23, 2015 at 03:16:42PM +0100, Jakub Jelinek wrote: > On Mon, Nov 23, 2015 at 03:12:05PM +0100, Martin Jambor wrote: > > +/* Thread routine to run a kernel asynchronously. */ > > + > > +static void * > > +run_kernel_asynchronously (void *thread_arg) > >

[hsa] omp_target_associate_ptr and omp_target_is_present on shared memory

2015-11-25 Thread Martin Jambor
Hi, when looking at why target-12.c and target-24.c in libgomp/testsuite/libgomp.c/, I found two other places in libgomp's target.c where shared-memory devices ought to be treated like the host. Committed to the branch. Thanks, Martin 2015-11-25 Martin Jambor <mjam...@suse.cz> l

Re: Enable pointer TBAA for LTO

2015-11-23 Thread Martin Jambor
Hi, On Mon, Nov 23, 2015 at 12:00:25AM +0100, Jan Hubicka wrote: > Hi, > here is updated patch which I finally comitted today. It addresses all the > comments > and also fixes one nasty bug that really cost me a lot of time to understand. > > + /* LTO type merging does not make any

[hsa] Fix operand and instruction types for bit-ops

2015-11-23 Thread Martin Jambor
Hi, I have applied the following patch tot he HSA branch to fix some rather unexpected type requirements of the HSA finalizer we discovered when running the target-3[34].c libgomp tests. Thanks, Martin 2015-11-23 Martin Jambor <mjam...@suse.cz> * hsa-gen.c (gen_hsa_binary_ope

[hsa] depend nowait support for target

2015-11-23 Thread Martin Jambor
few places where libgomp has to treat shared memory devices like it treats host, and so I added that to the patch too. The hunk in gomp_create_target_task should have been in the previous merge from trunk but I forgot to add it then. Any feedback welcome, Martin 2015-11-23 Martin J

[hsa] Use new format of device-specific target arguments

2015-11-23 Thread Martin Jambor
part of this one, then there are 8 bits for an ID of the argument and then up to 16 bits for a value. Thanks, Martin 2015-11-20 Martin Jambor <mjam...@suse.cz> gcc/ * omp-low.c (get_target_argument_identifier_1): New function. (get_target_argument_identifier): Li

[hsa] Perform version checks in HSA plugin

2015-11-23 Thread Martin Jambor
welcome, Martin 2015-11-23 Martin Jambor <mjam...@suse.cz> gcc/ * builtin-types.def (BT_FN_VOID_PTR_INT_PTR): Removed. (BT_FN_VOID_UINT_PTR_INT_PTR): New. * fortran/types.def (BT_FN_VOID_PTR_INT_PTR): Removed. (BT_FN_VOID_UINT_PTR_INT_PTR): New.

[hsa] Pass kernel launch attributes through a device-specific argument

2015-11-13 Thread Martin Jambor
Hi, this hsa patch is analogous to the for-trunk RFC I have sent a while ago and implements passing HSA-specific grid sizes through a device-specific argument. Committed to the branch. Thanks, Martin 2015-11-13 Martin Jambor <mjam...@suse.cz> include/ * gomp-const

[RFC] Device-specific OpenMP target arguments

2015-11-13 Thread Martin Jambor
will be an identifier and the second one the value itself. As suggested by Jakub, the first two elements will be common NUM_TEAMS and THREAD_LIMIT from the teams construct, if present. Any comments welcome, Thanks, Martin 2015-11-13 Martin Jambor <mjam...@suse.cz> include/ * gomp-const

Re: [hsa 5/12] New HSA-related GCC options

2015-11-13 Thread Martin Jambor
On Thu, Nov 12, 2015 at 12:19:50PM +0100, Jakub Jelinek wrote: > On Mon, Nov 09, 2015 at 05:58:56PM +0100, Martin Jambor wrote: > > > But I don't see any way to disable it on the command line? (no switch?) > > > > No, the switch is -foffload, which has missing doc

[hsa] Merged trunk revision 230248 into the hsa branch

2015-11-12 Thread Martin Jambor
Hi I have just Merged trunk revision 230248 into the hsa branch. I will prepare a new submission for inclusion to trunk tomorrow. Thanks, Martin

Re: [hsa 7/12] Disabling the vectorizer for GPU kernels/functions

2015-11-10 Thread Martin Jambor
On Fri, Nov 06, 2015 at 09:38:21AM +0100, Richard Biener wrote: > On Thu, 5 Nov 2015, Martin Jambor wrote: > > > Hi, > > > > in the previous email I wrote we need to "change behavior" of a few > > optimization passes. One was the flattenin

Re: [hsa 3/12] HSA libgomp plugin

2015-11-09 Thread Martin Jambor
Hi, On Thu, Nov 05, 2015 at 10:47:44PM +, Joseph Myers wrote: > This new file should have the standard libgomp copyright / license notice. > Oops, thanks for pointing this out. I am about to commit the following remedy to the branch. Thanks, Martin 2015-11-09 Martin Jambor

Re: [hsa 1/12] Configuration and offloading-related changes

2015-11-09 Thread Martin Jambor
On Thu, Nov 05, 2015 at 10:47:15PM +, Joseph Myers wrote: > On Thu, 5 Nov 2015, Martin Jambor wrote: > > > libgomp plugin to be built. Because the plugin needs to use HSA > > run-time library, I have introduced options --with-hsa-runtime (and > > more pr

Re: [hsa 5/12] New HSA-related GCC options

2015-11-09 Thread Martin Jambor
Hi, On Fri, Nov 06, 2015 at 09:42:25AM +0100, Richard Biener wrote: > On Thu, 5 Nov 2015, Martin Jambor wrote: > > > Hi, > > > > the following small part of the merge deals with new options. It adds > > four independent things: > > > > 1)

Re: [hsa 4/12] OpenMP lowering/expansion changes (gridification)

2015-11-09 Thread Martin Jambor
Hi, On Thu, Nov 05, 2015 at 10:57:33PM +0100, Martin Jambor wrote: > ... > > For convenience of anybody reviewing the code, I'm attaching a very > simple testcase with selection of dumps that illustrate the whole > process. > My apologies, I have forgotten to attach t

Merge of HSA branch

2015-11-05 Thread Martin Jambor
Hi, we have had a few last-minute issues, so I apologize this is happening a bit late, but I would like to start the process or merging the HSA branch to GCC trunk. Changes to different parts of the compiler and libgomp are posted as individual emails in this thread. No two patches touch any

[hsa 6/12] IPA-HSA pass

2015-11-05 Thread Martin Jambor
ignificant on GPUs) and makes sure both the CPU and GPU functions are coupled together and remain in the same LTO partition so that they can b registered together to libgomp. Thanks, Martin 2015-11-05 Martin Liska <mli...@suse.cz> Martin Jambor <mjam...@suse.cz>

[hsa 2/12] Modifications to libgomp proper

2015-11-05 Thread Martin Jambor
for a function called from a kernel (possibly in a different compilation unit), we also resort to host fallback. Last but not least, the patch removes data remapping when the selected device is capable of sharing memory with the host. Thanks, Martin 2015-11-02 Martin Jambor <mjam...@suse

[hsa 12/12] HSA register allocator

2015-11-05 Thread Martin Jambor
2015-11-05 Michael Matz <m...@suse.de> Martin Jambor <mjam...@suse.cz> * hsa-regalloc.c: New file. diff --git a/gcc/hsa-regalloc.c b/gcc/hsa-regalloc.c new file mode 100644 index 000..3919258 --- /dev/null +++ b/gcc/hsa-regalloc.c @@ -0,0 +1,711 @@

[hsa 1/12] Configuration and offloading-related changes

2015-11-05 Thread Martin Jambor
to observe that decision. That is what the opts.c hunk does. Thanks, Martin 2015-11-04 Martin Jambor <mjam...@suse.cz> gcc/ * Makefile.in (OBJS): Add new source files. (GTFILES): Add hsa.c. * configure.ac (accel_dir_suffix): Treat hsa specially. (OFFLOAD_

[hsa 9/12] Small alloc-pool fix

2015-11-05 Thread Martin Jambor
not call placement new, which is only safe to use from within a new operator. The patch also fixes the slightly weird two parameter operator new (which we do not use in HSA backend) so that it does not do the same. Thanks, Martin 2015-11-05 Martin Liska <mli...@suse.cz>

[hsa 8/12] Pass manager changes

2015-11-05 Thread Martin Jambor
Hi, the following pathch has been actually already committed to trunk by Martin yesterday, but is necessary if you have an older trunk. It allows an optimization pass to declare the functon finished by returning TODO_discard_function. The pass manager will then discard the function. Martin

[hsa 4/12] OpenMP lowering/expansion changes (gridification)

2015-11-05 Thread Martin Jambor
k regarding the approach. Thanks, Martin 2015-11-05 Martin Jambor <mjam...@suse.cz> * builtin-types.def (BT_FN_VOID_PTR_INT_PTR): New. (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Removed. (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New. * fo

[hsa 5/12] New HSA-related GCC options

2015-11-05 Thread Martin Jambor
to make it a parameter rather than a switch to emphasize the fact it will go away and to possibly allow us select different levels of verbosity of the stores in the future). Thanks, Martin 2015-11-05 Martin Jambor <mjam...@suse.cz> * common.opt (disable_hsa): New va

[hsa 7/12] Disabling the vectorizer for GPU kernels/functions

2015-11-05 Thread Martin Jambor
urse). We are actually quite close to being able to handle gimple vector input in HSA back-end but not all the way yet, and before allowing the vectorizer again, we will have to make sure it never produces vectors bigger than 128bits (in GPU functions). Thanks, Martin 2015-11-05 Martin Jam

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