This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.
ClosedPublic

Authored by gchatelet on Jun 5 2018, 7:54 AM.

Diff Detail

Event Timeline

gchatelet created this revision.Jun 5 2018, 7:54 AM
gchatelet updated this revision to Diff 149988.Jun 5 2018, 8:06 AM

Updating D47785: [llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.

gchatelet updated this revision to Diff 149990.Jun 5 2018, 8:16 AM

Updating D47785: [llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.

courbet added inline comments.Jun 6 2018, 4:41 AM
tools/llvm-exegesis/lib/BenchmarkResult.cpp
44

this won't work for arm/power.

47

Really ? :D
Then use a custom format in serialize(), else this will not work. You also need to make sure that you're using the ansi C locale.

gchatelet updated this revision to Diff 150116.Jun 6 2018, 5:33 AM
gchatelet marked 2 inline comments as done.

Updating D47785: [llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.

tools/llvm-exegesis/lib/BenchmarkResult.cpp
44

As discussed, the registers are guaranteed to have a name (MCRegisterInfo::getName), these names are derived from the enums defined in `llvm/lib/Target/XXX/XXXGenRegisterInfo.inc.
Because they are valid identifier they have to start with a letter, LLVM convention defines enums in uppercase.

47

As discussed, I used an encoding scheme for numbers.

courbet accepted this revision.Jun 6 2018, 5:40 AM
This revision is now accepted and ready to land.Jun 6 2018, 5:40 AM
courbet added inline comments.Jun 6 2018, 11:58 PM
tools/llvm-exegesis/lib/BenchmarkResult.cpp
18

This should be
static constexpr const char kIntegerFormat[] = "i_0x%" PRId64 "x";

gchatelet updated this revision to Diff 150264.Jun 7 2018, 12:33 AM
gchatelet marked 3 inline comments as done.

Updating D47785: [llvm-exegesis] Serializes instruction's operand in BenchmarkResult's key.

This revision was automatically updated to reflect the committed changes.