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

Extend basic block without aggressive memory copy #121

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

qwe661234
Copy link
Collaborator

@qwe661234 qwe661234 commented Apr 4, 2023

Due to the significant overhead associated with using aggressive memory copy, we opted to use a pointer to the IR of the basic block we intend to merge, rather than copying the IR to the basic block we wish to extend.

The performance results obtained from running CoreMark using different implementation strategies for EBB are presented below. As we can see, aggressive memory copy substantially degrades performance.

  • Model: Core i7-8700
Test aggressive memcpy Compiler Iterations / Sec Speedup
BB clang-15 971.951
BB gcc-12 963.336
EBB O clang-15 1013.070 +4.2%
EBB O gcc-12 1020.391 +6%
EBB X clang-15 1160.894 +19.4%
EBB X gcc-12 1167.938 +21.2%

src/decode.h Outdated Show resolved Hide resolved
@jserv jserv changed the title Extend basic block with low cost Extend basic block with lower memory consumption Apr 4, 2023
src/decode.h Outdated Show resolved Hide resolved
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Improve git commit message. Always mention "IR" in capitalized form. You shall show explicit numbers about memory consumption and potential benefits.

src/emulate.c Outdated Show resolved Hide resolved
@jserv jserv changed the title Extend basic block with lower memory consumption Extend basic block without aggressive memory copy Apr 4, 2023
src/decode.h Outdated Show resolved Hide resolved
src/emulate.c Outdated Show resolved Hide resolved
src/emulate.c Outdated Show resolved Hide resolved
src/decode.h Outdated Show resolved Hide resolved
src/emulate.c Show resolved Hide resolved
Due to the significant overhead associated with using aggressive memory
copy, we opted to use a pointer to the begin of IR array of the basic block
we intend to merge, rather than copying whole IR array to the basic block
we wish to extend.

The performance results obtained from running CoreMark using different
implementation strategies for EBB are presented below. As we can see,
aggressive memory copy substantially degrades performance.

|Test| aggressive memcpy|Compiler | Iterations / Sec |Speedup|
|----+------------------+---------+------------------+-------|
| BB |                  |clang-15 |  971.951         |       |
|----+------------------+---------+------------------+-------|
| BB |                  | gcc-12  |  963.336         |       |
|----+------------------+---------+------------------+-------|
| EBB|       O          |clang-15 |  1013.070        | +4.2% |
|----+------------------+---------+------------------+-------|
| EBB|       O          | gcc-12  |  1020.391        | +6%   |
|----+------------------+---------+------------------+-------|
| EBB|       X          |clang-15 |  1160.894        | +19.4%|
|----+------------------+---------+------------------+-------|
| EBB|       X          | gcc-12  | 1167.938         | +21.2%|
@jserv jserv merged commit 66300d0 into sysprog21:master Apr 5, 2023
@qwe661234 qwe661234 deleted the wip/low_cost_EBB branch April 6, 2023 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants