-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Unify ARM thumb bit handling via CodeDelta in ILCompiler.Compiler #121427
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
base: main
Are you sure you want to change the base?
Conversation
- Add CodeDelta addend to all EmitReloc/EmitPointerReloc calls targeting IMethodNode - Add overload to ARMEmitter.EmitJMP to accept addend parameter - Remove thumb bit handling from ObjectWriter symbol definitions - Remove duplicate thumb bit masking logic from EmitOrResolveRelocation This standardizes thumb bit handling by using factory.Target.CodeDelta in relocations instead of manually adding it to symbol values in ObjectWriter. Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot I'm seeing Invalid instruction errors on CI. That means one of two things: You didn't update the usages of ARMEmitter.EmitJMP, so that new overload isn't being used. Please update the usages in ILCompiler.Compiler to call the new API. |
Add factory.Target.CodeDelta as addend parameter to all EmitJMP calls in ARM-specific files that jump to IMethodNode or AssemblyStubNode targets: - ARMUnboxingStubNode - ARMTentativeMethodNode - ARMJumpStubNode (with type check) - ARMReadyToRunHelperNode (5 locations) - ARMReadyToRunGenericHelperNode (5 locations) This ensures the thumb bit is properly encoded in the relocation addend rather than in the symbol value, fixing invalid instruction errors on ARM. Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Fixed in 448a08f. Updated all ARM EmitJMP call sites to pass
The new overload is now being used at all 13 call sites that jump to method or stub nodes. |
...eclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMJumpStubNode.cs
Outdated
Show resolved
Hide resolved
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Plan: Introduce CodeDelta abstraction into ILCompiler.Compiler
Based on detailed exploration and feedback:
Summary
Successfully introduced CodeDelta abstraction and updated all ARM call sites:
Changes Made:
factory.Target.CodeDeltain EmitReloc/EmitPointerRelocKey Fix:
The CI failures were due to missing CodeDelta in ARM EmitJMP calls. The new overload was added but not used at call sites, causing invalid instructions. Now all ARM jumps to method/stub nodes properly include the thumb bit via CodeDelta addend.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.