Skip to content

Add fixed-non-allocatable operand support#77

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
Amanieu:fixed
Sep 19, 2022
Merged

Add fixed-non-allocatable operand support#77
cfallin merged 1 commit into
bytecodealliance:mainfrom
Amanieu:fixed

Conversation

@Amanieu
Copy link
Copy Markdown
Contributor

@Amanieu Amanieu commented Sep 15, 2022

This allows a non-allocatable PReg to be passed on directly to the allocations vector without any liverange tracking from the register allocator. The main intended use case is to support ISA-specific special registers such as a fixed zero register.

Fixes #3

@Amanieu
Copy link
Copy Markdown
Contributor Author

Amanieu commented Sep 15, 2022

I got a 6% speedup in compilation time by replacing my uses of the zero register with Operand::fixed_nonallocatable. I was previously defining the zero register using Operand::reg_fixed_def on the entry instruction, which was subtly incorrect since regalloc could sometimes emit a move that would write to the zero register.

This allows a non-allocatable `PReg` to be passed on directly to the
allocations vector without any liverange tracking from the register
allocator. The main intended use case is to support ISA-specific special
registers such as a fixed zero register.
Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me; thanks!

@cfallin cfallin merged commit 1495c1e into bytecodealliance:main Sep 19, 2022
@cfallin cfallin mentioned this pull request Sep 20, 2022
@Amanieu Amanieu deleted the fixed branch November 24, 2023 08:46
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.

Come up with a better scheme for fixed-register usages

2 participants