Experimental backend for increasing the code transformation size of the default Android backend. Was used the below input-driven compiler optimization framework, based on iterative compilation:
PLDI'21:
Developer and User Transparent Compiler Optimization for Interactive Applications
Paschalis Mpeis, Pavlos Petoumenos, Kim Hazelwood, Hugh Leather,
@inproceedings{mpeis2021developer,
title={Developer and User-Transparent Compiler Optimization for Interactive Applications},
author={Mpeis, Paschalis and Petoumenos, Pavlos and Hazelwood, Kim and Leather, Hugh},
booktitle={42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation},
year={2021},
organization={ACM Digital Library}
}
All modified/additional files can be found here: FILES.md.
Several components must be compiled and installed on a mobile device.
The compilation is explained below.
Once compilation is done, those components
have to be installed through magisk-modules.
First the sources have to be setup.
You might also want to check the official guide. At the time of writing this README the below worked:
repo init -u https://android.googlesource.com/platform/manifest -b android10-release --partial-clone --clone-filter=blob:limit=10M
# (authentication method can also be used)
repo sync -j32
The following repositories should be put in the AOSP ROOT directory:
- AOSP ROOT:
- art (this repository)
- bionic
- external/llvmx
B2. Compile LLVM Compiler: external/llvmx
libLLVM.so
, llvm-link
, opt
, llc
, lld
need to be generated.
See external/llvmx for instructions.
This repository should be placed at:
<AOSP-ROOT>/external/llvmx
B3.1 platform/bionic
Modifications to the linker that will allow loading shared libraries that were compiled by the LLVM backend.
linker
and linker64
need to be generated.
This repository should be placed at:
<AOSP-ROOT>/bionic
Compilation:
m linker 2>&1
libart.so
, libart-compiler.so
, and dex2oat
need to be generated using:
This repository should be placed at:
<AOSP ROOT>/art
Compilation:
m -j16 libart libart-compiler dex2oat 2>&1
Additional compilations notes: COMPILATION.md
- Make sure that every needed component is compiled (see AOSP Compilations).
- Make sure that these components are installed on a supported device (tested mainly on Flame).
- Then demo app should be installed.
- Finally, the scripts at tools/llvm can be used for compiling a hot region of the demo app.