DynamoRIO / DynamoRIO/dynamorio
DynamoRIO mixes Intel AVX and Intel SSE code
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 30
Description
As mentioned on [Intel optimization manual](https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf) in "Mixing AVX code with SSE code" section:
> If software inter-mixes AVX and SSE instructions without using VZEROUPPER properly, it can experience an AVX/SSE transition penalty
I have noticed that this causes a significant performance regression when running DynamoRIO on Intel Skylake (model 85)
For instance, taking into account an application which performs a simple for loop, compiled with `-ftree-vectorize -O3`:
```
int N=10000;
__attribute__((noinline)) void vector_triad(const double* __restrict a, const double* __restrict b, double* __restrict c, double scale){
//__asm__("vzeroupper");
for(int i=0; i 0m2.844s`
`time drrun -- app --> 0m14.376s`
When instead running the same application adding the "vzeroupper" command (reported in the code as comment):
`time drrun -- app --> 0m3.225s`
Is there a fix that could be implemented inside DynamoRIO in order to prevent such slowdown?
Contributor guide
Assessment
This issue has not been assessed yet.