This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix result for conditional reductions matching at index 0
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: Kilian Verhetsel <kilian dot verhetsel at uclouvain dot be>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Thu, 23 Nov 2017 09:51:04 +0000
- Subject: Re: [PATCH] Fix result for conditional reductions matching at index 0
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan dot Hayward at arm dot com;
- Nodisclaimer: True
- References: <87d14brhj6.fsf@uclouvain.be> <CAFiYyc3VrW4bVB9WXQ4yMhPRn_FpV6T3vAA=6YLVi5CdZopHEg@mail.gmail.com> <87zi7fbn07.fsf@uclouvain.be> <CAFiYyc2GcuaKcD8XgfT0XkFd=gCRFiaM=eHMXFTK1P1Ct4rWzw@mail.gmail.com> <E4166ABC-97D0-4A48-B1C6-5EAB06CC1979@arm.com> <CAFiYyc2jzbC4x-h=+8ksNz4Oc90U4XMqrhqNHnwf+Tj=84Vckg@mail.gmail.com> <87wp2ib6aj.fsf@uclouvain.be>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
> On 22 Nov 2017, at 16:57, Kilian Verhetsel <kilian.verhetsel@uclouvain.be> wrote:
>
>
> Thank you both for your comments.
>
> I have added the check to ensure the index vector won't cause an
> overflow. I also added tests to the testsuite in order to check that the
> loop is vectorized for UINT_MAX - 1 iterations but not UINT_MAX
> iterations. I was not able to write code that triggers
> INTEGER_INDUC_COND_REDUCTION when using char or other smaller types
> (changing the types of last, min_v and a to something else causes
> COND_REDUCTION to be used instead), so these tests are only compiled and
> not executed.
I had similar problems when playing around with -14.c, but didn’t have chance to
investigate why. Possibly worth raising a bug to mentioning there is a missed
optimisation. It’d be nice to figure out why.
>
> I also moved an instruction that generates a vector of zeroes (used for
> COND_REDUCTION) in the branch of code run only for COND_REDUCTION, this
> should remove the unused vector that Alan noticed.
Patch is ok for me.
Alan.