Issues with loop unrolling: better pinned node

Paul Sandoz paul.sandoz at oracle.com
Fri Aug 6 16:04:10 UTC 2021


Hi Rado,

It’s good you are looking at the IR

Out of curiosity, what happens if you turn off bounds checking [*]?

Paul.

[*]
-Djdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK=0

> On Aug 6, 2021, at 8:39 AM, Radosław Smogura <mail at smogura.eu> wrote:
> 
> Hi all,
> 
> I've found that even if we get rid of barriers, the loop can't get unrolled, and not needed code is inside it.
> 
> I've found this graph, I wonder if it's most optimal, in a partiucalry Load of ByteBuffer index / hb is from phi, could it be attached to initial memory?
> 
> Here's a picture https://drive.google.com/file/d/1G7ZN0xHOVIVHmZ_5TTIUdm3F30okAzvO/view?usp=sharing
> [https://lh6.googleusercontent.com/SKgGZgfVWFpG8w4mWqguLSU4DVfa1MKYPSQhxv8EoX04XzVz8U8Kc4zHP0iwdR26Suc=w1200-h630-p]<https://drive.google.com/file/d/1G7ZN0xHOVIVHmZ_5TTIUdm3F30okAzvO/view?usp=sharing>
> bb_issues.png<https://drive.google.com/file/d/1G7ZN0xHOVIVHmZ_5TTIUdm3F30okAzvO/view?usp=sharing>
> drive.google.com
> 
> 
> And sample code
> 
> protected void copyMemory(ByteBuffer in, ByteBuffer out) {
>  var limit = SPECIES.loopBound(in.limit());
>  for (int i=0; i < limit; i += SPECIES.vectorByteSize()) {
>    final var v = ByteVector.fromByteBuffer(SPECIES, in, i, ByteOrder.nativeOrder());
>    v.intoByteBuffer(out, i, ByteOrder.nativeOrder());
>  }
> }
> 
> Kind regards,
> Rado



More information about the panama-dev mailing list