-
Notifications
You must be signed in to change notification settings - Fork 44
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
Ior examples #53
base: main
Are you sure you want to change the base?
Ior examples #53
Conversation
The register input/output reporter is a new encoded instruction consuming component (IOReporter) which can provide information on the source and destination registers used by an instruction or sequence of instructions. Examples of its use are provided in a follow-up patch.
Example code that uses the IOReporter class to log register use in single instructions and simulated sequences.
Hi! Thanks for working on this on behalf of the AOSP team. We are using This PR makes it possible, and the interface looks good, except for one detail: we would need to run an extra decoder pass on the generated code in order to get that information. It would be more convenient for our use case to be able to query that information from the |
Hi. Thanks for taking a look. |
No, this will be debug-only code, so for our purposes this will be ok. My question was mostly to check if it will be easy/reasonable for you to move this logic to the MacroAssembler instead of Decoder.
The goal is to construct a control flow graph with use/def statements in the basic blocks. In essence, just the assembly program represented as a graph, all irrelevant information filtered out. (If you wonder why we may want this: we want to generate a mirror program on virtual registers instead of hardware ones, with an unbounded number of virtual registers, and put that program in SSA form. Then we will check if some hardware register maps to different virtual registers, one of which is defined while the other one is still used --- this means that the assembly code clobbers the hardware register.) To construct such a graph, we will need to dump use/def information for every instruction, or maybe for blocks that span between control-flow changing instructions like B and IT. |
Thanks for the explanation. I think moving the logic into the macro assembler isn't easy, and makes impossible one of the applications I'd considered: analysis of externally-generated instructions. I'll think about how we might add a similar feature to the macro assembler, for use during generation. I expect it'll use the code in this pull request to generate instrumentation in the macro assembler, so I can share some of the rules and testing. However, I'm unlikely to get to producing something in this area until 2023. |
Sounds good, there's definitely no rush on our side. Thanks for your work! |
No description provided.