Skip to content

Optimize normalization of == and != #1218

Open
@sjakobi

Description

@sjakobi

BoolEQ t u -> case (evalE t, evalE u) of
(VBoolLit True, u) -> u
(t, VBoolLit True) -> t
(t, u) | conv env t u -> VBoolLit True
(t, u) -> VBoolEQ t u
BoolNE t u -> case (evalE t, evalE u) of
(VBoolLit False, u) -> u
(t, VBoolLit False) -> t
(t, u) | conv env t u -> VBoolLit False
(t, u) -> VBoolNE t u

In both cases we currently quickly pull out what I consider to be the rather big hammer of conv. I suspect that we should try to cover all combinations of BoolLits before we resort to conv. I haven't benchmarked this yet though!

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceAll the slow and inefficient things

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions