[llvm] Add hybrid function ordering support (PR #186003)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 05:06:09 PDT 2026


https://github.com/paschalis-mpeis approved this pull request.

Hey YongKang,

Thanks for your work, looks good.

Some thoughts below:
`function-order` is not fully standalone from `--reorder-functions`, right?

For example the behavior would be:
1. if a user wants to use a `function-order` file, they would supply:
`--function-order=<file> --reorder-functions=user`, right?

2. To enable hybrid mode they can use:
`--function-order=<file> --reorder-functions=<anything-but-user>`

I think we could clean the CLI a bit in a future PR by adding more explicit messages, eg:
- `--function-order=<file>`: WARN: function-order used but no `--reorder-functions`
- `--function-order=<file> --reorder-functions=<anything-but-user>`: WARN: Combinging function-order with `--reorder-functions` (hybrid-mode)

https://github.com/llvm/llvm-project/pull/186003


More information about the llvm-commits mailing list