This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Add partial X87 support.
ClosedPublic

Authored by courbet on Jun 26 2018, 5:06 AM.

Details

Summary

This enables the X86-specific X86FloatingPointStackifierPass, and allow
llvm-exegesis to generate and measure X87 latency/uops for some FP ops.

Diff Detail

Repository
rL LLVM

Event Timeline

courbet created this revision.Jun 26 2018, 5:06 AM
gchatelet added inline comments.Jun 26 2018, 7:34 AM
tools/llvm-exegesis/lib/BenchmarkRunner.cpp
201 ↗(On Diff #152873)

As discussed, let's create SelfAliasing in the function so we don't rely on the caller to do the right thing.

tools/llvm-exegesis/lib/Latency.cpp
94 ↗(On Diff #152873)

Let's do the following:

auto result = generateSelfAliasingPrototype(Instr);
if(result is ok) return result;
return generateTwoInstructionPrototype(Instr);
courbet updated this revision to Diff 153037.Jun 27 2018, 3:51 AM

address review comments

gchatelet added inline comments.Jun 27 2018, 5:38 AM
tools/llvm-exegesis/lib/BenchmarkRunner.cpp
201 ↗(On Diff #153037)

Move just above the if (where it's used)

203 ↗(On Diff #153037)

Move below if (SelfAliasing.empty()) block.

tools/llvm-exegesis/lib/Latency.cpp
92 ↗(On Diff #153037)

this is not needed it you use the llvm idiom

if(auto SelfAliasingPrototype = generateSelfAliasingPrototype(Instr)) {
   return SelfAliasingPrototype;
}
courbet marked 2 inline comments as done.Jun 27 2018, 7:06 AM
courbet added inline comments.
tools/llvm-exegesis/lib/Latency.cpp
92 ↗(On Diff #153037)

Unfortunately this does not work as is leaves the error unchecked.

courbet updated this revision to Diff 153077.Jun 27 2018, 7:07 AM

address review comments

courbet updated this revision to Diff 153079.Jun 27 2018, 7:11 AM

better scoping

gchatelet accepted this revision.Jun 27 2018, 7:14 AM
This revision is now accepted and ready to land.Jun 27 2018, 7:14 AM
courbet updated this revision to Diff 153080.Jun 27 2018, 7:15 AM

Use BenchmarkFailure instead of llvm::StringError

This revision was automatically updated to reflect the committed changes.