Skip to content

Conversation

aengelke
Copy link
Contributor

This avoids the indirection through MCID when just accessing the opcode. This uses two of the four padding bytes at the end of MachineInstr.


http://llvm-compile-time-tracker.com/compare.php?from=54cb5ca9f48fc542b920662a0eee7c0e6f35bee0&to=b0f960613dd2188e2673663b9e8e38d2092e7d3f&stat=instructions:u

The actual performance impact might be slightly larger, as the MCID is less likely to be in cache than the MachineInstr.

This avoids the indirection through MCID when just accessing the opcode.
@MaskRay
Copy link
Member

MaskRay commented Jun 26, 2024

I checked the best place for Opcode but it seems that the end is good.

@arsenm
Copy link
Contributor

arsenm commented Jun 27, 2024

We have a bunch of full bools in MachineInstr, does turning those into bitfields do anything?

@aengelke
Copy link
Contributor Author

We have a bunch of full bools in MachineInstr, does turning those into bitfields do anything?

The only bools I see are in (out-of-line) ExtraInfo, which is not directly part of MachineInstr and not always allocated.

@aengelke aengelke merged commit aa24e36 into llvm:main Jun 27, 2024
@aengelke aengelke deleted the perf/machineinstr-opcode branch June 27, 2024 15:10
cpiaseque pushed a commit to cpiaseque/llvm-project that referenced this pull request Jul 3, 2024
This avoids the indirection through MCID when just accessing the opcode.
This uses two of the four padding bytes at the end of MachineInstr.
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
This avoids the indirection through MCID when just accessing the opcode.
This uses two of the four padding bytes at the end of MachineInstr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants