-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-inline_constInline constants (aka: const blocks, const expressions, anonymous constants)Inline constants (aka: const blocks, const expressions, anonymous constants)
Description
inline_const
tracking issue: #76001
Inspired by @oli-obk's comment in #85828 (comment)
For things like if const { expr } { 0 } else { do something complex }
it'd be nice to not have to even give LLVM the code for the else branch to have to emit. Ought to save time and binary size.
Tentatively marked mir-opt, since we presumably still need to make the MIR for it, in order to borrow-check and such the unreachable code. But might need to be codegen-time instead to pick up on monomorphized inline constants.
Hopefully should be doable relatively easily when the const is an inline const, since that forces const folding already, and thus there should just be a const true
in the MIR.
BoxyUwU, hudson-ayers, osiewicz and griffi-gh
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-inline_constInline constants (aka: const blocks, const expressions, anonymous constants)Inline constants (aka: const blocks, const expressions, anonymous constants)