This is an archive of the discontinued LLVM Phabricator instance.

[Docs][llvm-exegesis] Specify supported platforms and architectures
ClosedPublic

Authored by aidengrossman on Apr 27 2023, 1:27 PM.

Details

Summary

Currently, there is no documentation on what platforms and architectures
llvm-exegesis is supported on. This patch adds in user-facing
documentation in the CommandGuide about what architectures are supported
as well as developer facing documentation detailing the technical
reasons for why certain platforms are supported and some aren't.

This is a follow-up after discussion in
https://discourse.llvm.org/t/clarification-on-platform-support-for-llvm-exegesis/70206.

Diff Detail

Unit TestsFailed

Event Timeline

aidengrossman created this revision.Apr 27 2023, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 1:27 PM
Herald added a subscriber: mstojanovic. · View Herald Transcript
aidengrossman requested review of this revision.Apr 27 2023, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 1:27 PM
aidengrossman added subscribers: jsji, john.brawn, atanasyan.

@jsji @atanasyan @john.brawn In case they have any suggestions on what more specificity in currently supported architectures.

Fix poorly resolved merge conflict that resulted in duplicate section in llvm-exegesis.rst.

As far as I know, all powerpc(64)?(le)?-linux-gnu triples are reported as unsupported except for powerpc64le-..., so PowerPC support seems to be not unconditional.

Considering calling conventions, some parts of it are probably hardcoded in snippet generators and repetitors and some are queried from LLVM subtarget info. The benchmark function accepts char *Memory argument that can be unused if snippet consists of only non memory related instructions. If loop repetitor is used, it may hardcode loop counter register that may interfere with unexpected calling convetions. On the other hand, prologue and epilogue are emitted by generic LLVM machinery and some ABI-specific information can be queried from it (see getFunctionReservedRegs from Assembler.cpp for example). Thus chances are that snippets generated for non-memory instructions with "duplicate" repetitor might be runnable even with non-SysV calling conventions.

llvm/docs/CommandGuide/llvm-exegesis.rst
36

[nit] Missing space between "ARM" and "("

aidengrossman marked an inline comment as done.Apr 29 2023, 12:35 AM

Right. Some of it will work but a lot of it won't work and will probably crash. All of the parts that I'm aware of call into the ExegesisTarget implementations to get specific registers to use. In the case of getScratchMemoryRegister, for the x86 implementation, it does seem like Windows is supported as the function accepts a triple and changes the register depending upon the platform, so it seems like the ABI differences are better accounted for than I thought, and the the other snippet repetitor implementations, specifically the loop one, seem to take this into account when choosing registers.

kpdev42 accepted this revision.May 3 2023, 4:19 AM
This revision is now accepted and ready to land.May 3 2023, 4:19 AM
This revision was landed with ongoing or failed builds.May 13 2023, 2:07 AM
This revision was automatically updated to reflect the committed changes.
RKSimon added inline comments.
llvm/docs/CommandGuide/llvm-exegesis.rst
38

Do we need to make it clear that analysis mode DOES work on any platform - just the capture modes have limitations?