This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Generate snippet setup code.
ClosedPublic

Authored by courbet on Jun 25 2018, 4:15 AM.

Details

Summary

This ensures that the snippet always sees the same values for registers,
making measurements reproducible.
This will also allow exploring different values.

Diff Detail

Event Timeline

courbet created this revision.Jun 25 2018, 4:15 AM
courbet updated this revision to Diff 152665.Jun 25 2018, 5:10 AM

Simplify: VR128X (xmm0-31) includes VR128 (xmm0-8) and FR(32|64|128)X? (low subword of xmm).

courbet updated this revision to Diff 152667.Jun 25 2018, 5:24 AM

Y/ZMM loads require a different opcode.

gchatelet added inline comments.Jun 25 2018, 5:56 AM
tools/llvm-exegesis/lib/BenchmarkRunner.cpp
142

"a mov" -> "an assignment"

unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
253

remove

unittests/tools/llvm-exegesis/X86/TargetTest.cpp
41

SizeIs(Gt(0)) ?

courbet updated this revision to Diff 152673.Jun 25 2018, 6:01 AM
courbet marked 3 inline comments as done.

address review comments

gchatelet accepted this revision.Jun 25 2018, 6:05 AM
This revision is now accepted and ready to land.Jun 25 2018, 6:05 AM
This revision was automatically updated to reflect the committed changes.
pcc added a subscriber: pcc.Jun 25 2018, 1:31 PM
pcc added inline comments.
llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
40 ↗(On Diff #152677)

Looks like this line has caused a build warning:

utils/unittest/googlemock/include/gmock/gmock-matchers.h:216:60: warning: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Wsign-compare]
  bool operator()(const A& a, const B& b) const { return a > b; }
                                                         ~ ^ ~
[...]
unittests/tools/llvm-exegesis/X86/TargetTest.cpp:40:3: note: in instantiation of function template specialization 'testing::internal::PredicateFormatterFromMatcher<testing::internal::SizeIsMatcher<testing::internal::GtMatcher<int> > >::operator()<std::vector<llvm::MCInst, std::allocator<llvm::MCInst> > >' requested here
  EXPECT_THAT(Insts, SizeIs(Gt(0)));
  ^
courbet added inline comments.Jun 25 2018, 11:04 PM
llvm/trunk/unittests/tools/llvm-exegesis/X86/TargetTest.cpp
40 ↗(On Diff #152677)

Sorry about that. This was fixed in r335547.