From patchwork Wed Nov 18 21:40:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 546220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D62B141420 for ; Thu, 19 Nov 2015 08:40:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=enPIdPT8; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=q8TMTDNz1fC9EyttyXQo8tEXQGkUJnaB/uP9x8Avl2XswAAlfx ftHDcUSuCjQocY7nHQQOtI7RNEqA+U0Q9PU0WoqXm6zq9Mw72kmJATZG/dLTt/hc gfCN0Wh2qetZSvaQyH70h6eT94XhDBd1SuxJePMLanIT6+ugrUZG0ae1g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=P1LgNXeMZ0aH+IfaxIXDAiPa96Y=; b=enPIdPT8+wafOKuuyRWD 0RY+SCWI7io6VwoEz4m46yrzvsb10ucn5zdhkvH9WUbLRDtXFdRXCEIcBbMe1UMb zYH7oE0GkY5htqVDgqb6eH+N0xE1MEmCXkdKrRdPrSEwkjdAmordJfbRelk7ADIv quFZ9twH/CFSF1HuZvxgClo= Received: (qmail 12337 invoked by alias); 18 Nov 2015 21:40:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 12319 invoked by uid 89); 18 Nov 2015 21:40:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_50, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vk0-f48.google.com Received: from mail-vk0-f48.google.com (HELO mail-vk0-f48.google.com) (209.85.213.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 18 Nov 2015 21:40:30 +0000 Received: by vkha189 with SMTP id a189so4576322vkh.2 for ; Wed, 18 Nov 2015 13:40:28 -0800 (PST) X-Received: by 10.31.50.193 with SMTP id y184mr1047174vky.128.1447882828201; Wed, 18 Nov 2015 13:40:28 -0800 (PST) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id l129sm795350vke.25.2015.11.18.13.40.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Nov 2015 13:40:27 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: [gomp4] backport ptx changes from trunk Message-ID: <564CF04B.8040900@acm.org> Date: Wed, 18 Nov 2015 16:40:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 I've committed this to gomp4 branch. It removes some extraneous pieces from nvptx.c and backports comments and some minor reworking that got applied to trunk. nathan (nvptx_neuter_pars): Backport from trunk. Index: gcc/config/nvptx/nvptx.c =================================================================== --- gcc/config/nvptx/nvptx.c (revision 230571) +++ gcc/config/nvptx/nvptx.c (working copy) @@ -66,14 +66,6 @@ #include "tree-phinodes.h" #include "cfgloop.h" #include "fold-const.h" -#include "cfghooks.h" -#include "dumpfile.h" -#include "dominance.h" -#include "cfg.h" -#include "tree-cfg.h" -#include "gimple-ssa.h" -#include "ssa-iterators.h" -#include "tree-into-ssa.h" /* This file should be included last. */ #include "target-def.h" @@ -2003,7 +1995,6 @@ nvptx_print_operand_address (FILE *file, A -- print an address space identifier for a MEM c -- print an opcode suffix for a comparison operator, including a type code f -- print a full reg even for something that must always be split - R -- print an address space specified by CONST_INT S -- print a shuffle kind specified by CONST_INT t -- print a type opcode suffix, promoting QImode to 32 bits T -- print a type size in bits @@ -2056,13 +2047,6 @@ nvptx_print_operand (FILE *file, rtx x, fprintf (file, "%s", nvptx_ptx_type_from_mode (op_mode, false)); break; - case 'R': - { - addr_space_t as = UINTVAL (x); - fputs (nvptx_section_from_addr_space (as), file); - } - break; - case 'S': { unsigned kind = UINTVAL (x); @@ -3216,9 +3200,24 @@ nvptx_find_sese (auto_vec & basic_block to = regions[ix].second; if (from) - fprintf (dump_file, "%s %d{%d->%d}", comma, ix, - from->index, to->index); + { + fprintf (dump_file, "%s %d{%d", comma, ix, from->index); + if (to != from) + fprintf (dump_file, "->%d", to->index); + + int color = BB_GET_SESE (from)->color; + + /* Print the blocks within the region (excluding ends). */ + FOR_EACH_BB_FN (block, cfun) + { + bb_sese *sese = BB_GET_SESE (block); + if (sese && sese->color == color + && block != from && block != to) + fprintf (dump_file, ".%d", block->index); + } + fprintf (dump_file, "}"); + } comma = ","; } fprintf (dump_file, "\n\n"); @@ -3712,11 +3711,11 @@ nvptx_neuter_pars (parallel *par, unsign if (neuter_mask) { - int ix; - int len; - + int ix, len; + if (nvptx_optimize) { + /* Neuter whole SESE regions. */ bb_pair_vec_t regions; nvptx_find_sese (par->blocks, regions); @@ -3734,6 +3733,7 @@ nvptx_neuter_pars (parallel *par, unsign } else { + /* Neuter each BB individually. */ len = par->blocks.length (); for (ix = 0; ix != len; ix++) { @@ -3742,7 +3742,6 @@ nvptx_neuter_pars (parallel *par, unsign nvptx_single (neuter_mask, block, block); } } - } if (skip_mask) @@ -3913,7 +3912,7 @@ nvptx_record_offload_symbol (tree decl) tree attr = get_oacc_fn_attrib (decl); tree dims = TREE_VALUE (attr); unsigned ix; - + fprintf (asm_out_file, "//:FUNC_MAP \"%s\"", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); @@ -4085,6 +4084,7 @@ nvptx_expand_cmp_swap (tree exp, rtx tar return target; } + /* Codes for all the NVPTX builtins. */ enum nvptx_builtins { @@ -4319,7 +4319,7 @@ nvptx_generate_vector_shuffle (location_ gimplify_assign (dest_var, expr, seq); } -/* Lazily generate the global lock var decl and return its addresss. */ +/* Lazily generate the global lock var decl and return its address. */ static tree nvptx_global_lock_addr () @@ -4353,7 +4353,7 @@ nvptx_global_lock_addr () guess = actual; write = guess OP myval; actual = cmp&swap (ptr, guess, write) - } while (actual bit-differnt-to guess); + } while (actual bit-different-to guess); return write; This relies on a cmp&swap instruction, which is available for 32-