From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70318 invoked by alias); 29 Sep 2016 19:26:38 -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 70305 invoked by uid 89); 29 Sep 2016 19:26:37 -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,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=polishing, H*f:sk:1475138, H*MI:sk:1475138, H*i:sk:1475138 X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Sep 2016 19:26:27 +0000 Received: by mail-wm0-f49.google.com with SMTP id w72so1029653wmf.0 for ; Thu, 29 Sep 2016 12:26:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5Mb3YFdfMIhg/kHgIJKu7Fk+vWSm2gG5embmeLirmDs=; b=Qhjdsm6/n2tC6TDycESzcyjn72HxO1phwmBqEAjW43j8qspLi0odZ7TrUKjeUJUFH8 QJkjh/FTF3B4zb7cx6tsc2GN8gWKss3MNbpF+y5M4sI7c7Apn8TpnWoi67g1dlKo8N5f a5XR3l3zpCUy+ZEHnET7GAP3GgYoOTuRY9u2UQNGZv+xPB8sCunkcTxtY5W/d2nbjCgP hWjT4fyKipOh1GhfLZ75aSkvdQdLWHaajN06XUMzY0kyIf8UDaKWxm97x5Hp5MhU49R2 98AZMwzMUIuEi8MnqY5YjaIn3Gs3MKx+uLeSqQRZrBDlhNG/eYQVfMmQ5QVYrDg/ZISW lIWg== X-Gm-Message-State: AA6/9RkWJqdPCzGFiEoKbVfRoCnUoSNlJWw+r7sk7/rFplDp1PIgWREwvktmF5H1s05xnA== X-Received: by 10.194.233.102 with SMTP id tv6mr2981865wjc.35.1475177185432; Thu, 29 Sep 2016 12:26:25 -0700 (PDT) Received: from localhost (host86-165-30-128.range86-165.btcentralplus.com. [86.165.30.128]) by smtp.gmail.com with ESMTPSA id u185sm236846wmu.20.2016.09.29.12.26.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2016 12:26:24 -0700 (PDT) Date: Thu, 29 Sep 2016 19:45:00 -0000 From: Andrew Burgess To: Claudiu Zissulescu Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Disable compact casesi patterns for arcv2 Message-ID: <20160929192616.GF18222@embecosm.com> References: <20160927145428.GM6374@embecosm.com> <1475138462-32447-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1475138462-32447-1-git-send-email-claziss@synopsys.com> X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.6.1 (2016-04-27) X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg02288.txt.bz2 * Claudiu Zissulescu [2016-09-29 10:41:02 +0200]: > Here it is. The previous version had more mods which should be in a different patch. > > Please let me know if you still have issues with it, > Claudiu > > gcc/ > 2016-05-09 Claudiu Zissulescu > > * common/config/arc/arc-common.c (arc_option_optimization_table): > Remove compact casesi option. > * config/arc/arc.c (arc_override_options): Use compact casesi > option only for pre-ARCv2 cores. > --- > gcc/common/config/arc/arc-common.c | 1 - > gcc/config/arc/arc.c | 7 +++++++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/gcc/common/config/arc/arc-common.c b/gcc/common/config/arc/arc-common.c > index f5b9c6d..5b687fb 100644 > --- a/gcc/common/config/arc/arc-common.c > +++ b/gcc/common/config/arc/arc-common.c > @@ -56,7 +56,6 @@ static const struct default_options arc_option_optimization_table[] = > { OPT_LEVELS_ALL, OPT_mbbit_peephole, NULL, 1 }, > { OPT_LEVELS_SIZE, OPT_mq_class, NULL, 1 }, > { OPT_LEVELS_SIZE, OPT_mcase_vector_pcrel, NULL, 1 }, > - { OPT_LEVELS_SIZE, OPT_mcompact_casesi, NULL, 1 }, > { OPT_LEVELS_NONE, 0, NULL, 0 } > }; > > diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c > index 2b25b0b..825bccf 100644 > --- a/gcc/config/arc/arc.c > +++ b/gcc/config/arc/arc.c > @@ -858,6 +858,13 @@ arc_override_options (void) > if (arc_size_opt_level == 3) > optimize_size = 1; > > + /* Compact casesi is not a valid option for ARCv2 family, disable > + it. */ > + if (TARGET_V2) > + TARGET_COMPACT_CASESI = 0; > + else if (optimize_size == 1) > + TARGET_COMPACT_CASESI = 1; > + > if (flag_pic) > target_flags |= MASK_NO_SDATA_SET; I wonder if we should warn for the TARGET_V2 case? Currently if the option is supplied on an ARCv2 (-mcompact-casesi) then the option is silently ignored. This might confuse some users. In the non TARGET_V2 case I notice that the option is _always_ enabled, with no option of disabling the option. If we add a check of global_options_set then we can make this smarter, default on, but can still be tuned off if a user ever wants to. The alternative would be to entirely remove the TARGET_COMPACT_CASESI flag altogether? While I was thinking about this I wrote the code below, it probably needs polishing, but gives an idea of what I have in mind. What do you think? Thanks, Andrew --- diff --git a/gcc/common/config/arc/arc-common.c b/gcc/common/config/arc/arc-common.c index f5b9c6d..5b687fb 100644 --- a/gcc/common/config/arc/arc-common.c +++ b/gcc/common/config/arc/arc-common.c @@ -56,7 +56,6 @@ static const struct default_options arc_option_optimization_table[] = { OPT_LEVELS_ALL, OPT_mbbit_peephole, NULL, 1 }, { OPT_LEVELS_SIZE, OPT_mq_class, NULL, 1 }, { OPT_LEVELS_SIZE, OPT_mcase_vector_pcrel, NULL, 1 }, - { OPT_LEVELS_SIZE, OPT_mcompact_casesi, NULL, 1 }, { OPT_LEVELS_NONE, 0, NULL, 0 } }; diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 2b25b0b..65a5c10 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -858,6 +858,18 @@ arc_override_options (void) if (arc_size_opt_level == 3) optimize_size = 1; + /* Compact casesi is not a valid option for ARCv2 family. */ + if (TARGET_V2 + && global_options_set.x_TARGET_COMPACT_CASESI + && global_options.x_TARGET_COMPACT_CASESI) + { + warning (0, "compact-casesi is not applicable to arc-v2"); + TARGET_COMPACT_CASESI = 0; + } + else if (optimize_size == 1 + && !global_options_set.x_TARGET_COMPACT_CASESI) + TARGET_COMPACT_CASESI = 1; + if (flag_pic) target_flags |= MASK_NO_SDATA_SET;