RFR: 8183390: Fix and re-enable post loop vectorization [v3]

Jatin Bhateja jbhateja at openjdk.java.net
Tue Jan 25 16:45:33 UTC 2022


On Tue, 25 Jan 2022 09:41:01 GMT, Pengfei Li <pli at openjdk.org> wrote:

> Hi Jatin,
> 
> > BTW why have you kept a constraint on the vector size of post tail loop to match MaxVectorSize ?
> 
> I just did more investigation about why there was a MaxVectorSize constraint. By looking at the failure after removing that, I found in some smaller MaxVectorSize configurations, the main loop may unroll more times than the vector lane count. In this scenario, the vector drain loop is not cloned from the atomic vector main loop. Without the vector drain loop, 1 iteration would be **NOT** enough for the vector masked tail loop so the test case generates incorrect result. Hence, we need to keep the MaxVectorSize constraint to make sure it's enough for the vector masked tail loop to run at most 1 iteration.
> 
> I'd be glad if you have more suggestions.

Hi Pengfie,

Thanks for clarification, can we not prevent generating post vector masked tail iteration in case there is no vector atomic loop after unrolled main vector loop. This can guard against any performance penalties associated with usage of 64 byte vectors in drain loop if main loop operates over smaller vectors.

Regards,
Jatin

-------------

PR: https://git.openjdk.java.net/jdk/pull/6828


More information about the hotspot-dev mailing list