Skip to content
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

aot: place precheck wrapper before the corresponding wrapped function #3141

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

yamt
Copy link
Collaborator

@yamt yamt commented Feb 6, 2024

This increases the chance to use "short" calls.

Assumptions:

  • LLVM preserves the order of functions in a module
  • The wrapper function are smaller than the wrapped functions
  • The target CPU has "short" PC-relative variation of call/jmp instructions and they are preferrable over the "long" ones.

A motivation:

  • To avoid some relocations for XIP, I want to use xtensa PC-relative call instructions, which can only reach ~512KB.

This increases the chance to use "short" calls.

Assumptions:
- LLVM preserves the order of functions in a module
- The wrapper function are smaller than the wrapped functions
- The target CPU has "short" PC-relative variation of call/jmp instructions
  and they are preferrable over the "long" ones.

A motivation:
- To avoid some relocations for XIP, I want to use xtensa PC-relative
  call instructions, which can only reach ~512KB.
Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

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

LGTM

@wenyongh wenyongh merged commit 5931aaa into bytecodealliance:main Feb 6, 2024
395 checks passed
wenyongh added a commit that referenced this pull request Feb 17, 2024
Apply patches in branch main for branch `release/1.3.x`:
- Fix loader check_wasi_abi_compatibility (#3126)
- Zero the memory mapped from os_mmap in NuttX (#3132)
- Fix possible integer overflow in loader target block check (#3133)
- Fix locel.set in polymorphic stack (#3135)
- Fix threads opcodes' boundary check in classic-interp and fast-interp (#3136)
- aot_compile_op_call: Stop setting calling convention explicitly (#3140)
- aot compiler: Place precheck wrapper before the corresponding wrapped function (#3141)
- fast-interp: Fix copy_stack_top_i64 overlap issue (#3146)
- fast-interp: Fix frame_offset overflow issue (#3149)
- Fix null pointer access in fast-interp when configurable soft bound check is enabled (#3150)
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
… function (bytecodealliance#3141)

This increases the chance to use "short" calls.

Assumptions:
- LLVM preserves the order of functions in a module
- The wrapper function are smaller than the wrapped functions
- The target CPU has "short" PC-relative variation of call/jmp instructions
  and they are preferrable over the "long" ones.

A motivation:
- To avoid some relocations for XIP, I want to use xtensa PC-relative
  call instructions, which can only reach ~512KB.
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.

2 participants