[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
Thu Jan 16 09:13:26 PST 2025


efriedma-quic wrote:

The two issues are sort of tied together: if the intrinsic isn't IntrNoMem, I suspect the assumption cache stops cooperating.

But anyway, I guess the question is really whether we want these constructs represented explicitly in IR, to try to leverage the AssumptionCache, or if we want to instead add a TTI hook for transform passes to query for the information in question.  My default is not to use assumptions; llvm.assume calls still cause issues for optimizations, and they're not really necessary here.  (I think the situation around llvm.assume has improved to some extent, but it's still a bit problematic.)

Even if we do decide we want assumptions, we likely want to add them in an IR pass, instead of in clang, so that other frontends don't need to duplicate this code.

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


More information about the cfe-commits mailing list