FastExpressionCompiler
FastExpressionCompiler copied to clipboard
Try interpret a switch expression - if switch value is interpretable (constant) then select a single matched branch
TBD the same idea for the conditional?
but caller cannot embeed that const as const? or jit optimizes this?
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.