Issues with loop unrolling: better pinned node
Radosław Smogura
mail at smogura.eu
Fri Aug 6 15:39:57 UTC 2021
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