There's a joke that the LLVM heuristic for whether to inline a function is "return true;" LLVM tends to inline aggressively.
You can control this behavior with opt level "s" or "z" or "#[inline(never)]", but be aware that too little inlining can have large negative performance impacts.
It's hard to get inlining exactly right without profile guided optimization.