Skip to content

[llvm-mca] Add binary support to llvm-mca. #38180

@llvmbot

Description

@llvmbot
Bugzilla Link 38832
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @ahmedbougacha,@adibiagio,@atrick,@legrosbuffle,@topperc,@gchatelet,@hfinkel,@RKSimon,@rotateright

Extended Description

Currently, llvm-mca operates on asm source. The goal of this bug/feature is to give llvm-mca the ability to operate on object files and not just asm source. This change will require llvm-mca to enable/initialize the target disassemblers and locate user-annotated code regions. Each code region should be executed in a separate simulated pipeline within llvm-mca, similar to how llvm-mca currently executes multiple code regions that have been annotated in the user's asm source.

To locate user defined code regions in an object file, llvm will need to store
the start/end .text offsets, that represent the user's annotations, into a MCSection of the user's object file. For an ELF file, this can be a section called ".mca_code_segments", where the content of this region is a set of pairs: <.text offset begin, .text offset end>. llvm-mca will locate these code regions, and perform analysis on each region within a simulated pipeline. This change will probably require a pair of intrinsics, to represent the user's annotations, which will eventually be lowered into a representation that will be used to make up the contents of the llvm-mca specific MCSection.

An example looks something like the following:

.text
.Lmca_segment1_start:
... # Code to be analyzed by mca
.Lmca_segment1_end:
... # More code, not analyzed by mca
.mca_code_segments:
.Lmca_segment1_start, .Lmca_segment1_end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions