1. WD RISCV inliner work effort
Nidal Faour â toolchain engineer
Western Digital
April 19, 2021
2. Agenda
London Open Source Meetup for RISC-V
⢠Introduction
⢠LLVM inliner
⢠New approach
⢠SuggestedSolution
3. Introduction
⢠Decrease code size
⢠Compare with other target
⢠Compare with other compilers
⢠Finding weak points in the assembly
⢠Tweak the compiler passes to fix the weak points
4. ⢠One of the weak points we found was in
the LLVM inliner, where other compilers
found more inlining opportunities and
made the code size smaller.
⢠The major limitation is the way the inliner
works
⢠We need another approach to solve this.
LLVM inliner
5. ⢠Credits for MI â (mutual inliner) goes to
Phd. Yosi Ben Asher
⢠Look at the whole picture
⢠Include the whole call-graph effect in the
inlining decisions
New approach - MI
B Saving C Saving
D Saving D Saving
E Saving F Saving
6. ⢠Integrate the MI inside the LLVM inliner
⢠Replace the LLVM inliner
⢠Use the inliner adviser to give the LLVM
more insight using the MI algorithm
Suggested solution