Issues with loop unrolling: better pinned node

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Fri Aug 6 17:41:13 UTC 2021


Can you double-check why the Phi is not split through the MemoryMerge 
nodes [1]?

I suspect self-referential nature of the IR shape (it's a memory state 
inside the loop after all) poses some challenges which aren't evident on 
the screenshot you made.

Best regards,
Vladimir Ivanov

[1] 
https://github.com/openjdk/panama-vector/blob/master/src/hotspot/share/opto/cfgnode.cpp#L2187

On 06.08.2021 18:39, Radosław Smogura 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