This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Save target state before running the benchmark.
ClosedPublic

Authored by courbet on Nov 2 2020, 1:59 AM.

Details

Summary

Some benchmarked instructions might set target state. Preserve this
state. See PR26418.

Diff Detail

Event Timeline

courbet created this revision.Nov 2 2020, 1:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2020, 1:59 AM
Herald added a subscriber: mstojanovic. · View Herald Transcript
courbet requested review of this revision.Nov 2 2020, 1:59 AM

Can you reformat to fix Lint errors as well.

llvm/tools/llvm-exegesis/lib/Target.h
178

I find PreservedState a bit unclear. Maybe SavedState or SnapshotState is more explicit? No strong opinion though.

courbet marked an inline comment as done.Nov 2 2020, 4:39 AM

Thanks, PTAL.

courbet updated this revision to Diff 302243.Nov 2 2020, 4:40 AM

Address review comments

gchatelet accepted this revision.Nov 2 2020, 4:41 AM
This revision is now accepted and ready to land.Nov 2 2020, 4:41 AM
This revision was landed with ongoing or failed builds.Nov 2 2020, 6:03 AM
This revision was automatically updated to reflect the committed changes.
anna added a subscriber: anna.Nov 12 2020, 9:56 AM

Just recording here (previous discussion was here D90742) :
our internal buildbots at Azul has failed because of an older assembler. We’ve taken in all commits/reverts/relands w.r.t this change upto Nov 4th. I have reverted the change rG8383fddc4fa9 downstream and confirmed the build passes.

The specific failure is:
/tmp/cc2lBtEi.s: Assembler messages:
/tmp/cc2lBtEi.s:541: Error: no such instruction: `fxsave64 16(%rax)'
/tmp/cc2lBtEi.s:566: Error: no such instruction: `fxrstor64 16(%rdi)'
/tmp/cc2lBtEi.s:592: Error: no such instruction: `fxrstor64 16(%rdi)'
make[2]: *** [tools/llvm-exegesis/lib/X86/CMakeFiles/LLVMExegesisX86.dir/Target.cpp.o] Error 1

We use the GNU assembler and it is configured for 64 bit machines. Here's the details from one of the machines:

as --version
GNU assembler version 2.20.51.0.2-5.47.el6_9.1 20100205
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-redhat-linux'

Just recording here (previous discussion was here D90742) :
our internal buildbots at Azul has failed because of an older assembler. We’ve taken in all commits/reverts/relands w.r.t this change upto Nov 4th. I have reverted the change rG8383fddc4fa9 downstream and confirmed the build passes.

The specific failure is:
/tmp/cc2lBtEi.s: Assembler messages:
/tmp/cc2lBtEi.s:541: Error: no such instruction: `fxsave64 16(%rax)'
/tmp/cc2lBtEi.s:566: Error: no such instruction: `fxrstor64 16(%rdi)'
/tmp/cc2lBtEi.s:592: Error: no such instruction: `fxrstor64 16(%rdi)'
make[2]: *** [tools/llvm-exegesis/lib/X86/CMakeFiles/LLVMExegesisX86.dir/Target.cpp.o] Error 1

We use the GNU assembler and it is configured for 64 bit machines. Here's the details from one of the machines:

as --version
GNU assembler version 2.20.51.0.2-5.47.el6_9.1 20100205
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-redhat-linux'

This does look too old now (2009). For GCC, llvm-project currently requires at least 5.1 (2015). I'll not expect GCC 5.1 to ship a binutils from 2009:)

In addition, if you use -fintegrated-as, you don't need to worry about the version of GNU as.