From patchwork Mon Oct 10 15:23:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 680480 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 3st4r05f5Nz9s5w for ; Tue, 11 Oct 2016 03:11:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=u2AhYUIg; 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 :resent-from:resent-date:resent-message-id:resent-to:from:date :subject:to:message-id; q=dns; s=default; b=GLtxtT4H3hKwKicKH8n+ 4MJtJbReJi8iE76sk4MIt0WEOE9bTfGObW2jPO+QK62IL7GhJDjjQJOIlhdqWjJ4 hrDRqIPMz0HxwNXg+wy7iq0n3MTEXspU6+qStRyniFDwvrEBjCTJJEtMhKwuwV5c axrLV/D/cZ1vie7thLIFHj0= 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 :resent-from:resent-date:resent-message-id:resent-to:from:date :subject:to:message-id; s=default; bh=V83vMWLnh5aBr+J5litkBm11Tj Y=; b=u2AhYUIggpWEuV96TGj839eM3YqNem3T5VuVB4n8seWycuesep0Tui4rF3 sBY6jZQBgjH3rt2wSlC1ONS7WzP5VpMkMkhDIwjazycVdNM1beyG33ilhrcAZGu8 TxTwn5KvSoTGEI4wpqCIGzSYZywlBptUujagFsrRZbDBumb8A= Received: (qmail 88702 invoked by alias); 10 Oct 2016 16:09:39 -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 88472 invoked by uid 89); 10 Oct 2016 16:09:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*MI:eggs, H*M:eggs, gimple_location, HX-detected-operating-system:timestamps X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Oct 2016 16:09:23 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btd8i-0002L7-In for gcc-patches@gcc.gnu.org; Mon, 10 Oct 2016 12:09:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:45036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btd8i-0002KY-C0 for gcc-patches@gcc.gnu.org; Mon, 10 Oct 2016 12:09:20 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AABCFADCB for ; Mon, 10 Oct 2016 16:09:17 +0000 (UTC) Resent-From: Martin Jambor Resent-Date: Mon, 10 Oct 2016 18:09:17 +0200 Resent-Message-ID: <20161010160917.5ygw2mh7h2wjh7cg@virgil.suse.cz> Resent-To: GCC Patches From: Martin Jambor Date: Mon, 10 Oct 2016 17:23:29 +0200 Subject: [hsa-branch 7/9] Ignore prefetch builtin To: GCC Patches X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] Message-ID: X-Received-From: 195.135.220.15 X-IsSubscribed: yes Hi, this patch makes HSAIL expansion ignore prefetch built-ins. It is a bit less straightforward because we also need to handle cases where the call does not pass gimple_call_builtin_p test because of argument type mismatches. Committed to the branch, queued for merge to trunk soon. Thanks, Martin 2016-10-03 Martin Jambor * hsa-gen.c (gen_hsa_insns_for_call): Ignore prefetch builtin. --- gcc/hsa-gen.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c index ad40087..8893a28 100644 --- a/gcc/hsa-gen.c +++ b/gcc/hsa-gen.c @@ -5530,6 +5530,12 @@ gen_hsa_insns_for_call (gimple *stmt, hsa_bb *hbb) if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)) { tree function_decl = gimple_call_fndecl (stmt); + /* Prefetch pass can create type-mismatching prefetch builtin calls which + fail the gimple_call_builtin_p test above. Handle them here. */ + if (DECL_BUILT_IN_CLASS (function_decl) + && DECL_FUNCTION_CODE (function_decl) == BUILT_IN_PREFETCH) + return; + if (function_decl == NULL_TREE) { HSA_SORRY_AT (gimple_location (stmt), @@ -5962,6 +5968,8 @@ gen_hsa_insns_for_call (gimple *stmt, hsa_bb *hbb) gen_hsa_alloca (call, hbb); break; } + case BUILT_IN_PREFETCH: + break; default: { gen_hsa_insns_for_direct_call (stmt, hbb);