Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #3935
Closed
Open
Issue created Nov 13, 2019 by Administrator@rootContributor

DynamoRIO mixes Intel AVX and Intel SSE code

Created by: andrea-brunato-ARM

As mentioned on Intel optimization manual 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<N; i++){
                c[i] = a[i] + scale * b[i];
        }
        return;
}

int main(int argc, char* argv[]){
        double* a = new T[N];
        double* b = new T[N];
        double* c = new T[N];
        for(int j=0; j<1000000; j++){
                vector_triad(a,b,c,2.0);
        }
        return 0;
}

I can notice the following execution times:

time app --> 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?

Assignee
Assign to
Time tracking