llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.32k stars 12.12k forks source link

Improve cost modeling for RISC-V Machine Outliner #91788

Open ilovepi opened 6 months ago

ilovepi commented 6 months ago

This is a work item identified in the gap analysis done in https://github.com/llvm/llvm-project/issues/89822.

The ARM32 and Aarch64 machine outliners make many adjustments to the cost modeling depending on the outlining task. For instance it seems to increase weights for tail-callable outlined regions, and adjust the weights for various other patterns.

RISC-V should probably just copy these as a starting point and explore the impact of different values on some sufficiently large codebase. Clang, and the llvm-test suite are the obvious starting points, but Fuchsia, Chrome, and the Linux kernel are also reasonable projects to include for a round of evaluation.

llvmbot commented 6 months ago

@llvm/issue-subscribers-backend-risc-v

Author: Paul Kirth (ilovepi)

This is a work item identified in the gap analysis done in https://github.com/llvm/llvm-project/issues/89822. The ARM32 and Aarch64 machine outliners make many adjustments to the cost modeling depending on the outlining task. For instance it seems to increase weights for tail-callable outlined regions, and adjust the weights for various other patterns. RISC-V should probably just copy these as a starting point and explore the impact of different values on some sufficiently large codebase. Clang, and the llvm-test suite are the obvious starting points, but Fuchsia, Chrome, and the Linux kernel are also reasonable projects to include for a round of evaluation.