[PATCH] Fix result for conditional reductions matching at index 0
Alan Hayward
Alan.Hayward@arm.com
Thu Nov 23 10:30:00 GMT 2017
> 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.
More information about the Gcc-patches
mailing list