[clang] [clang] Emit @llvm.assume before streaming_compatible functions when the streaming mode is known (PR #121917)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 11:18:25 PST 2025


efriedma-quic wrote:

> However what we want to achieve with this is to make the state of the streaming mode known to potentially inlineable called functions, allowing for further inlining and identification/removal of dead code

It seems like we're in agreement that the llvm.assume doesn't actually add any information to the IR that the optimizer can't figure out itself.  It sounds like the issue here is that you don't just need the call to be folded; you need the InlineCost evaluator to constant-fold the call?  That makes things a little more complicated, but it still seems solvable...

llvm.assume handling is relatively expensive, so we don't want to scatter assume calls across emitted code when it isn't necessary.

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


More information about the cfe-commits mailing list