Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Abhishek Kaushik
Can we do __first + 4 <= __last? From: Jonathan Wakely Sent: Friday, January 31, 2025 8:28 PM To: libstd...@gcc.gnu.org Cc: Abhishek Kaushik ; gcc-patches@gcc.gnu.org Subject: Re: [PATCH] libstdc++: Use canonical loop form in std::reduce On Fri, 31 Jan 2

Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Abhishek Kaushik
f stl :) From: Richard Biener Sent: Friday, January 31, 2025 8:27 PM To: Jonathan Wakely Cc: Abhishek Kaushik ; libstd...@gcc.gnu.org ; gcc-patches@gcc.gnu.org Subject: Re: [PATCH] libstdc++: Use canonical loop form in std::reduce On Fri, Jan 31, 2025 at 2:50 PM Jonathan Wakely

Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Jonathan Wakely
On Fri, 31 Jan 2025 at 14:47, Marc Glisse wrote: > > On Fri, 31 Jan 2025, Abhishek Kaushik wrote: > > > The current while loop in std::reduce and related functions is hard to > > vectorize because the loop control variable is hard to detect in icx. > > > > `while ((__last - __first) >= 4)` > > > >

Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Richard Biener
17 00:00:00 2001 > > > From: Abhishek Kaushik > > > Date: Fri, 31 Jan 2025 01:28:48 -0800 > > > Subject: [PATCH] libstdc++: Use canonical loop form in std::reduce > > > > > > The current while loop in std::reduce and related functions is hard to > &

Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Marc Glisse
On Fri, 31 Jan 2025, Abhishek Kaushik wrote: The current while loop in std::reduce and related functions is hard to vectorize because the loop control variable is hard to detect in icx. `while ((__last - __first) >= 4)` Changing the loop header to a for loop following the OpenMP canonical form

[PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Abhishek Kaushik
>From 7a7c9a2a976fbb29f67c46284e7c1581cbe8cb07 Mon Sep 17 00:00:00 2001 From: Abhishek Kaushik Date: Fri, 31 Jan 2025 01:28:48 -0800 Subject: [PATCH] libstdc++: Use canonical loop form in std::reduce This change is for the INTEL C compiler (icx). The current while loop in std::reduce

Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Abhishek Kaushik
dxbaY From: Jonathan Wakely Sent: Friday, January 31, 2025 7:19 PM To: Richard Biener Cc: Abhishek Kaushik ; libstd...@gcc.gnu.org ; gcc-patches@gcc.gnu.org Subject: Re: [PATCH] libstdc++: Use canonical loop form in std::reduce On Fri, 31 Jan 2025 at 12:48, Richard Biener wrote: >

Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Jonathan Wakely
0800 > > Subject: [PATCH] libstdc++: Use canonical loop form in std::reduce > > > > The current while loop in std::reduce and related functions is hard to > > vectorize because the loop control variable is hard to detect. > > > > `while ((__last - __first) >=

Re: [PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Richard Biener
On Fri, Jan 31, 2025 at 12:01 PM Abhishek Kaushik wrote: > > From 4ac7c7e56e23ed2f4dd2dafdfab6cfa110c14260 Mon Sep 17 00:00:00 2001 > From: Abhishek Kaushik > Date: Fri, 31 Jan 2025 01:28:48 -0800 > Subject: [PATCH] libstdc++: Use canonical loop form in std::reduce > > The

[PATCH] libstdc++: Use canonical loop form in std::reduce

2025-01-31 Thread Abhishek Kaushik
>From 4ac7c7e56e23ed2f4dd2dafdfab6cfa110c14260 Mon Sep 17 00:00:00 2001 From: Abhishek Kaushik Date: Fri, 31 Jan 2025 01:28:48 -0800 Subject: [PATCH] libstdc++: Use canonical loop form in std::reduce The current while loop in std::reduce and related functions is hard to vectorize because