Comments (5)
Trying right away!
from clspv.
Note that it will not remove the fragmentation but only reduce it.
This is because this test is performing "unaligned" accesses.
from clspv.
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.
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.
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)
- SimplifyPointerBitcast performs wrong simplification HOT 1
- math functions issue since instcombine transform "and" pattern to call to fabs HOT 1
- Invalid word count when emitting OpConstant HOT 3
- Segmentation fault HOT 1
- OpAtomicUMax may have the wrong pointer type after cast + offset HOT 1
- Temporary Bugfix: SimplifyPointerBitcastPass emits faulty IR that loses OpLoads of 16 bit fields HOT 2
- ReplacePointerBitcastPass introduces invalid IR with struct field of a struct HOT 3
- migrate from deprecated Type::isOpaquePointerTy() to Type::isPointerTy() HOT 1
- Ternary operator on AMD vk drivers. HOT 3
- Segmentation fault with conditional pointer assignment from different address spaces HOT 4
- Canonicalization of GEPs to i8 HOT 10
- Constant initialized global variable rewrites produce invalid IR
- Handle LLVM intrinsic llvm.is_fpclass
- Loads of i32s are fragmented into 4 bytes HOT 3
- how can I cross compile clspv in x86 for risc-v HOT 1
- Loads and Stores of i32s from offset addresses are fragmented HOT 1
- Implement compatibility for external LLVM-IL HOT 15
- Clspv Fragments access to global memory by the Smallest access size
- Improve `-cl-mad-enable` support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clspv.