Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of runners' infrastructure and dumping object files #620

Merged
merged 4 commits into from
Apr 30, 2021

Conversation

georgemitenkov
Copy link
Collaborator

@georgemitenkov georgemitenkov commented Apr 30, 2021

This PR addresses the following:

  1. Dumping object files in JIT.

A functionality to dump (enabled by default) the generated from LLVM IR file binar to .o has been added to benchmarking. Now, in addition to logs, a v<vector_width>_<mod_filename>.o is generated. The reasons it is an object file and not an assembly (hence not included in logs) are the following:

  • LLVM does not have library functions that take the object and turn back into assembly, but rather object -> file -> assembly path. It also has a llvm-objdump tool, but it is intended as a command-line utility and does not have a well-defined API.
  • Writing custom functions to produce a readable assembly is not a priority. Also, mimicking objdump functionality would be difficult.
  • Both objdump and llvm-objdump can be used to isnpect the .o file manually.
  1. Refactoring of Runner class.
    In addition to the support of dumping the binary, Runner and JITDriver classes were refactored to have a nicer OOP-style.

fixes #611

@georgemitenkov georgemitenkov added enhancement New feature or request llvm labels Apr 30, 2021
@bbpbuildbot
Copy link
Collaborator

Can one of the admins verify this patch?

@georgemitenkov georgemitenkov linked an issue Apr 30, 2021 that may be closed by this pull request
Copy link
Contributor

@pramodk pramodk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM!

Quickly tested locally and looks good!

By the way - unrelated to PR - one thing I realised while testing is that we forgot to add/update README about the all options we are adding in LLVM branch. Every time I test something, I try to grab from history esp now new options about vec-replace, svml loading , benchmarking etc etc. 😅 I will try to help with documenting this with examples...

@georgemitenkov
Copy link
Collaborator Author

That’s a good point! I will make an issue for the README. I was postponing this to code refactoring/more comments (some places are not fully consistent and well documented (for people outside LLVM)). But we will definitely do this☺️

@georgemitenkov georgemitenkov merged commit e573fa1 into llvm Apr 30, 2021
@georgemitenkov georgemitenkov deleted the georgemitenkov/dumping-jit-module branch April 30, 2021 22:29
pramodk added a commit that referenced this pull request May 8, 2021
The following is added:

1. Dumping object files in JIT.

A functionality to dump (enabled by default) the generated from LLVM IR file binary to `.o` has been added to benchmarking. Now, in addition to logs, a `v<vector_width>_<mod_filename>.o` is generated. The reasons it is an object file and not an assembly (hence not included in logs) are the following:

- LLVM does not have library functions that take the object and turn back into assembly, but rather `object -> file -> assembly` path. It also has a `llvm-objdump` tool, but it is intended as a command-line utility and does not have a well-defined API.

- Writing custom functions to produce a readable assembly is not a priority. Also, mimicking `objdump` functionality would be difficult.

- Both `objdump` and `llvm-objdump` can be used to isnpect the `.o` file manually.

2. Refactoring of `Runner` class.

In addition to the support of dumping the binary, `Runner`and `JITDriver` classes were refactored to have a nicer OOP-style.

fixes #611

Co-authored-by: Pramod S Kumbhar <[email protected]>
pramodk added a commit that referenced this pull request Mar 8, 2022
The following is added:

1. Dumping object files in JIT.

A functionality to dump (enabled by default) the generated from LLVM IR file binary to `.o` has been added to benchmarking. Now, in addition to logs, a `v<vector_width>_<mod_filename>.o` is generated. The reasons it is an object file and not an assembly (hence not included in logs) are the following:

- LLVM does not have library functions that take the object and turn back into assembly, but rather `object -> file -> assembly` path. It also has a `llvm-objdump` tool, but it is intended as a command-line utility and does not have a well-defined API.

- Writing custom functions to produce a readable assembly is not a priority. Also, mimicking `objdump` functionality would be difficult.

- Both `objdump` and `llvm-objdump` can be used to isnpect the `.o` file manually.

2. Refactoring of `Runner` class.

In addition to the support of dumping the binary, `Runner`and `JITDriver` classes were refactored to have a nicer OOP-style.

fixes #611

Co-authored-by: Pramod S Kumbhar <[email protected]>
iomaganaris pushed a commit that referenced this pull request May 10, 2022
The following is added:

1. Dumping object files in JIT.

A functionality to dump (enabled by default) the generated from LLVM IR file binary to `.o` has been added to benchmarking. Now, in addition to logs, a `v<vector_width>_<mod_filename>.o` is generated. The reasons it is an object file and not an assembly (hence not included in logs) are the following:

- LLVM does not have library functions that take the object and turn back into assembly, but rather `object -> file -> assembly` path. It also has a `llvm-objdump` tool, but it is intended as a command-line utility and does not have a well-defined API.

- Writing custom functions to produce a readable assembly is not a priority. Also, mimicking `objdump` functionality would be difficult.

- Both `objdump` and `llvm-objdump` can be used to isnpect the `.o` file manually.

2. Refactoring of `Runner` class.

In addition to the support of dumping the binary, `Runner`and `JITDriver` classes were refactored to have a nicer OOP-style.

fixes #611

Co-authored-by: Pramod S Kumbhar <[email protected]>
iomaganaris pushed a commit that referenced this pull request May 12, 2022
The following is added:

1. Dumping object files in JIT.

A functionality to dump (enabled by default) the generated from LLVM IR file binary to `.o` has been added to benchmarking. Now, in addition to logs, a `v<vector_width>_<mod_filename>.o` is generated. The reasons it is an object file and not an assembly (hence not included in logs) are the following:

- LLVM does not have library functions that take the object and turn back into assembly, but rather `object -> file -> assembly` path. It also has a `llvm-objdump` tool, but it is intended as a command-line utility and does not have a well-defined API.

- Writing custom functions to produce a readable assembly is not a priority. Also, mimicking `objdump` functionality would be difficult.

- Both `objdump` and `llvm-objdump` can be used to isnpect the `.o` file manually.

2. Refactoring of `Runner` class.

In addition to the support of dumping the binary, `Runner`and `JITDriver` classes were refactored to have a nicer OOP-style.

fixes #611

Co-authored-by: Pramod S Kumbhar <[email protected]>
iomaganaris pushed a commit that referenced this pull request Sep 15, 2022
The following is added:

1. Dumping object files in JIT.

A functionality to dump (enabled by default) the generated from LLVM IR file binary to `.o` has been added to benchmarking. Now, in addition to logs, a `v<vector_width>_<mod_filename>.o` is generated. The reasons it is an object file and not an assembly (hence not included in logs) are the following:

- LLVM does not have library functions that take the object and turn back into assembly, but rather `object -> file -> assembly` path. It also has a `llvm-objdump` tool, but it is intended as a command-line utility and does not have a well-defined API.

- Writing custom functions to produce a readable assembly is not a priority. Also, mimicking `objdump` functionality would be difficult.

- Both `objdump` and `llvm-objdump` can be used to isnpect the `.o` file manually.

2. Refactoring of `Runner` class.

In addition to the support of dumping the binary, `Runner`and `JITDriver` classes were refactored to have a nicer OOP-style.

fixes #611

Co-authored-by: Pramod S Kumbhar <[email protected]>
iomaganaris pushed a commit that referenced this pull request Sep 15, 2022
The following is added:

1. Dumping object files in JIT.

A functionality to dump (enabled by default) the generated from LLVM IR file binary to `.o` has been added to benchmarking. Now, in addition to logs, a `v<vector_width>_<mod_filename>.o` is generated. The reasons it is an object file and not an assembly (hence not included in logs) are the following:

- LLVM does not have library functions that take the object and turn back into assembly, but rather `object -> file -> assembly` path. It also has a `llvm-objdump` tool, but it is intended as a command-line utility and does not have a well-defined API.

- Writing custom functions to produce a readable assembly is not a priority. Also, mimicking `objdump` functionality would be difficult.

- Both `objdump` and `llvm-objdump` can be used to isnpect the `.o` file manually.

2. Refactoring of `Runner` class.

In addition to the support of dumping the binary, `Runner`and `JITDriver` classes were refactored to have a nicer OOP-style.

fixes #611

Co-authored-by: Pramod S Kumbhar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request llvm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dumping LLVM JIT module to assembly
3 participants