Giter Club home page Giter Club logo

Comments (5)

BukeBeyond avatar BukeBeyond commented on June 4, 2024

Trying right away!

from clspv.

rjodinchr avatar rjodinchr commented on June 4, 2024

Note that it will not remove the fragmentation but only reduce it.
This is because this test is performing "unaligned" accesses.

from clspv.

BukeBeyond avatar BukeBeyond commented on June 4, 2024

It is working here, quite well actually!

About the alignment:

  %5 = load i64, ptr addrspace(1) %4, align 8
  %6 = getelementptr inbounds i8, ptr addrspace(1) %3, i64 44
  store i64 %5, ptr addrspace(1) %6, align 8

I see alignment, is there something else missing?

I compiled several variations of the above trigger after this fix. I also examined 35 programs, some above 100Kb in binary Spirv size, looking for fragmented (OpLoad %uchar 's and OpCompositeConstruct's). 32 are now completely fragment free. There was a specific case before this fix, 19Kb in binary Spirv size, now it is under 14Kb!

So something is working very well! Nothing is ever perfect, but soon we may get close enough. :-)

Thank you again Romaric.

from clspv.

rjodinchr avatar rjodinchr commented on June 4, 2024

What I meant by alignement, is that in Vulkan SPIR-V, if you have a SPIR-V variable defined as a i64 and you want to load a i64 from it at the offset 36, that makes an unaligned read that is not legal.
That's why is the end when you compiled your example with this fix, you can still see 2 i32 loads to perform the i64 load.

from clspv.

BukeBeyond avatar BukeBeyond commented on June 4, 2024

I see. I will look for any missing alignment as a possible trigger in the remaining cases.

But in most cases, these loads and stores are in fact, just flattened structures in memory, so Clang preserves their alignment. In our case, these structures get quite complex, which really challenges the old GEP code in Clspv, so we have been striving to flatten and reduce them to simple direct addresses.

I think getting your internal compilation to flatten these structure, will achieve the same stability we have been experiencing since the i8 GEP evolution. Optimisation passes, and some exclusive to Clang, have been able to flatten structures more completely after detecting them with the new and simplified byte offsets.

from clspv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.