FastExpressionCompiler icon indicating copy to clipboard operation
FastExpressionCompiler copied to clipboard

Try interpret a switch expression - if switch value is interpretable (constant) then select a single matched branch

Open dadhi opened this issue 2 months ago • 2 comments

TBD the same idea for the conditional?

dadhi avatar Nov 17 '25 10:11 dadhi

but caller cannot embeed that const as const? or jit optimizes this?

dzmitry-lahoda avatar Nov 20 '25 06:11 dzmitry-lahoda

Not clear what do you mean by embedding.

I meant to not spend compiler budget on emitting the branches that would never be taken anyway.

Someone could say, that it is responsibility of expression builder to remove unnecessary switch on the constant. Maybe. I know that sometimes expression parts are constructed in desparate parts of the lib/app. Sometimes the final expression is big enough and the context is already lost, so the user need to traverse everything to make such kind of optimizations.

dadhi avatar Nov 20 '25 20:11 dadhi