From ff2362eb3542969c01b94890b5442932eea8ec88 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Sun, 22 Mar 2015 23:50:00 +0100 Subject: [PATCH] Speed-up def_builtin_const (ix86_valid_target_attribute). * config/i386/i386.c (def_builtin): Set deferred_isa_values for masks that can potentially include a builtin. (ix86_add_new_builtins): Introduce fast filter for isa values that cannot trigger builtin inclusion. From-SVN: r221577 --- gcc/ChangeLog | 9 +++++++++ gcc/config/i386/i386.c | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 36c88ee3499..7e05b814765 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-03-22 Martin Liska + + Jakub Jelinek + + * config/i386/i386.c (def_builtin): Set deferred_isa_values for + masks that can potentially include a builtin. + (ix86_add_new_builtins): Introduce fast filter for isa values + that cannot trigger builtin inclusion. + 2015-03-22 Martin Liska * ipa-icf.c (sem_item::update_hash_by_addr_refs): New function. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 47deda7ce50..82a48482be6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -30588,6 +30588,8 @@ struct builtin_isa { static struct builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX]; +/* Bits that can still enable any inclusion of a builtin. */ +static HOST_WIDE_INT deferred_isa_values = 0; /* Add an ix86 target builtin function with CODE, NAME and TYPE. Save the MASK of which isa_flags to use in the ix86_builtins_isa array. Stores the @@ -30631,6 +30633,9 @@ def_builtin (HOST_WIDE_INT mask, const char *name, } else { + /* Just a MASK where set_and_not_built_p == true can potentially + include a builtin. */ + deferred_isa_values |= mask; ix86_builtins[(int) code] = NULL_TREE; ix86_builtins_isa[(int) code].tcode = tcode; ix86_builtins_isa[(int) code].name = name; @@ -30666,6 +30671,12 @@ def_builtin_const (HOST_WIDE_INT mask, const char *name, static void ix86_add_new_builtins (HOST_WIDE_INT isa) { + if ((isa & deferred_isa_values) == 0) + return; + + /* Bits in ISA value can be removed from potential isa values. */ + deferred_isa_values &= ~isa; + int i; tree saved_current_target_pragma = current_target_pragma; current_target_pragma = NULL_TREE; -- 2.30.2