This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH/AARCH64] Improve aarch64 conditional compare usage
- From: Steve Ellcey <sellcey at cavium dot com>
- To: Jeff Law <law at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Jun 2017 11:30:23 -0700
- Subject: Re: [PATCH/AARCH64] Improve aarch64 conditional compare usage
- Authentication-results: sourceware.org; auth=none
- Authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cavium.com;
- References: <firstname.lastname@example.org> <email@example.com>
- Reply-to: sellcey at cavium dot com
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Tue, 2017-06-27 at 16:45 -0600, Jeff Law wrote:
> > + /* If we have a boolean variable allow it and generate a compare
> > + to zero reg when expanding. */
> > + if (!g)
> > + return (TREE_CODE (TREE_TYPE (t)) == BOOLEAN_TYPE);
> Depending on how you use T, you might be better off checking T's range
> and considering anything with the [0,1] range as a boolean. That would
> also pick up the case where T was set via a comparison, or the output of
> a PHI with arguments that are all [0,1], etc. I've found that to be a
> useful improvement in a couple places.
> See ssa_name_has_boolean_range. I don't consider it a requirement for
> this patch to go forward, but more something you might want to
> investigate as a future improvement.
> OK for the trunk. Sorry about the delay.
Thanks Jeff, I checked this in. I hadn't considered integers with a
restricted range but it might be worth adding. I will look into that.