From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85457 invoked by alias); 22 Nov 2015 22:01:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 85434 invoked by uid 89); 22 Nov 2015 22:01:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f43.google.com Received: from mail-oi0-f43.google.com (HELO mail-oi0-f43.google.com) (209.85.218.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 22 Nov 2015 22:01:14 +0000 Received: by oige206 with SMTP id e206so103749268oig.2 for ; Sun, 22 Nov 2015 14:01:12 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.80.204 with SMTP id e195mr14687524oib.75.1448229672710; Sun, 22 Nov 2015 14:01:12 -0800 (PST) Received: by 10.76.72.3 with HTTP; Sun, 22 Nov 2015 14:01:12 -0800 (PST) In-Reply-To: <878u6aos0i.fsf@e105548-lin.cambridge.arm.com> References: <878u6aos0i.fsf@e105548-lin.cambridge.arm.com> Date: Sun, 22 Nov 2015 22:19:00 -0000 Message-ID: Subject: Re: Short-cut generation of simple built-in functions From: "H.J. Lu" To: GCC Patches , Richard Sandiford Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02628.txt.bz2 On Sat, Nov 7, 2015 at 5:31 AM, Richard Sandiford wrote: > This patch short-circuits the builtins.c expansion code for a particular > gimple call if: > > - the function has an associated internal function > - the target implements that internal function > - the call has no side effects > > This allows a later patch to remove the builtins.c code, once calls with > side effects have been handled. > > Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. > OK to install? > > Thanks, > Richard > > > gcc/ > * builtins.h (called_as_built_in): Declare. > * builtins.c (called_as_built_in): Make external. > * internal-fn.h (expand_internal_call): Define a variant that > specifies the internal function explicitly. > * internal-fn.c (expand_load_lanes_optab_fn) > (expand_store_lanes_optab_fn, expand_ANNOTATE, expand_GOMP_SIMD_LANE) > (expand_GOMP_SIMD_VF, expand_GOMP_SIMD_LAST_LANE) > (expand_GOMP_SIMD_ORDERED_START, expand_GOMP_SIMD_ORDERED_END) > (expand_UBSAN_NULL, expand_UBSAN_BOUNDS, expand_UBSAN_VPTR) > (expand_UBSAN_OBJECT_SIZE, expand_ASAN_CHECK, expand_TSAN_FUNC_EXIT) > (expand_UBSAN_CHECK_ADD, expand_UBSAN_CHECK_SUB) > (expand_UBSAN_CHECK_MUL, expand_ADD_OVERFLOW, expand_SUB_OVERFLOW) > (expand_MUL_OVERFLOW, expand_LOOP_VECTORIZED) > (expand_mask_load_optab_fn, expand_mask_store_optab_fn) > (expand_ABNORMAL_DISPATCHER, expand_BUILTIN_EXPECT, expand_VA_ARG) > (expand_UNIQUE, expand_GOACC_DIM_SIZE, expand_GOACC_DIM_POS) > (expand_GOACC_LOOP, expand_GOACC_REDUCTION, expand_direct_optab_fn) > (expand_unary_optab_fn, expand_binary_optab_fn): Add an internal_fn > argument. > (internal_fn_expanders): Update prototype. > (expand_internal_call): Define a variant that specifies the > internal function explicitly. Use it to implement the previous > interface. > * cfgexpand.c (expand_call_stmt): Try to expand calls to built-in > functions as calls to internal functions. > This caused: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68488 H.J.