BukeBeyond wrote:

We have fast AVX256 scanners that detect data change and generate a hash in a 
united pass.  When this code is inlined, it further optimizes to just a few 
instructions with constant size structures.

There is a lot of optimization potential for these flat data structures.   We 
can we use vector instructions to process them in large chunks.  However, 
padding bytes with random data is a problem.  Detecting padding locations, 
especially with multiple inheritance is not trivial.  __builtin_clear_padding() 
solves this problem.

Now we can simply mark a flat structure with;
```
struct F1 : Flat<F1> 
{ 
  int i;
  bool b; 
};
```
where Flat<> simply calls __builtin_clear_padding((F1*) this); at construction. 
 LLVM unites any redundant writes from further inheritance.  LLVM also combines 
clear padding and initializated field bytes into larger writes.

These flat objects can be detected with a concept, and now have special powers, 
like fast comparison and/or hashing, implemented generically outside of these 
objects.

This is made possible by this work here. 

Thank you!







https://github.com/llvm/llvm-project/pull/75371
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to