Open
Conversation
Agent-Logs-Url: https://github.com/microsoft/profile-explorer/sessions/73d867c4-8362-43ed-ab4f-a1772c3f20c6 Co-authored-by: jhpohovey <42473764+jhpohovey@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/profile-explorer/sessions/73d867c4-8362-43ed-ab4f-a1772c3f20c6 Co-authored-by: jhpohovey <42473764+jhpohovey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix build of basic blocks and control flow graph for ARM64 binaries
Fix ARM64 profile disassembly CFG parsing
May 7, 2026
Member
jhpohovey
approved these changes
May 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes ARM64 disassembly parsing by selecting the ASM IR mode based on the loaded PE binary's architecture, so ARM64 branches are correctly recognized when building basic blocks and CFG edges.
Changes:
- Add
SelectIRInfohelper to pickIRMode.ARM64orIRMode.x86_64based on PE architecture. - Initialize
DisassemblerSectionLoaderwith the architecture-appropriateICompilerIRInfo. - Add ARM64 conditional branch parser test verifying basic block split and CFG edges.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/ProfileExplorerCore/Compilers/ASM/DisassemblerSectionLoader.cs | Selects IR info based on PE architecture before Initialize. |
| src/ProfileExplorerCoreTests/ASMParserTests.cs | New test covering ARM64 conditional branch CFG creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| return binaryInfo?.Architecture switch { | ||
| Machine.Arm64 => new ASMCompilerIRInfo(IRMode.ARM64), | ||
| Machine.I386 => new ASMCompilerIRInfo(IRMode.x86_64), |
Comment on lines
+41
to
+42
| private static ICompilerIRInfo SelectIRInfo(ICompilerInfoProvider compilerInfo, string binaryFilePath) { | ||
| var binaryInfo = PEBinaryInfoProvider.GetBinaryFileInfo(binaryFilePath); |
| private static ICompilerIRInfo SelectIRInfo(ICompilerInfoProvider compilerInfo, string binaryFilePath) { | ||
| var binaryInfo = PEBinaryInfoProvider.GetBinaryFileInfo(binaryFilePath); | ||
|
|
||
| return binaryInfo?.Architecture switch { |
| 1008: d65f03c0 ret | ||
| """; | ||
|
|
||
| var function = ParseARM64(text, 12); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


ARM64 binaries loaded from profiles could be parsed using the session’s default x64 ASM IR mode. That prevented ARM64 branches from being recognized, so basic blocks and CFG edges were not built correctly.
IRMode.ARM64for ARM64 binaries even when the profile session initially defaults to x64.