[clang] [CIR] -Wreturn-type (1/2): Add an analysis classifying how control reaches a function's end (PR #239774)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 7 09:39:53 PST 2026
erichkeane wrote:
> The previous table in the description was considering LLVM lowering as part of the whole CIR time, adjusted to be more fair.
I guess this is at least a more reasonable comparison, and maybe the 'advantage' on the RHS will amortize it as we start adding more, but Corentin is right unfortunately, this is going to be very attached to this being 'default codegen' unless we can get CIRGen down to 1/20th or so.
I think there is a lot of value to this happening ASAP (because I'm excited about the potential for more CFG-like analysis to be created in CIR, and the various diagnostics we can put in place as a side effect!), but its going to be gated for a while by lowering.
> @bcardosolopes Well, I was excited for this but at a minimum it means we cannot sunset the CFG until we sunset the current codegen.
>
> Do you have the number for codegen + cfg vs clangir + check + cir -> llvm ir? that would give a more complete picture imo.
>
> That being said, I'll review that next week, mostly for my own interests.
THIS is still going to be quite a bit behind. JUST the AST->clangir->llvmir picture is about 20% slower than AST->llvmir or so, so this probably isn't much of a 'net gain' even then. However, it DOES make these passes effectively 'free' once the clangir flow is default codegen (and we hope to get that 20% back over time).
https://github.com/llvm/llvm-project/pull/239774
More information about the cfe-commits
mailing list