Skip to content
  • Alyssa Rosenzweig's avatar
    nir: Implement optional b2f->iand lowering · 5d85a0a5
    Alyssa Rosenzweig authored
    
    
    This pass is required by the Midgard compiler; our instruction set uses
    NIR-style booleans (~0 for true) but lacks a dedicated b2f instruction.
    Normally, this lowering pass would be implemented in a backend-specific
    algebraic pass, but this conflicts with the existing iand->b2f pass in
    nir_opt_algebraic.py, hanging the compiler. This patch thus makes the
    existing pass optional (default on -- all other backends should remain
    unaffected), adding an optional pass for lowering the opposite
    direction.
    
    v2: Defer lowering until late algebraic optimisations to allow
    optimising the b2f instruction itself.
    
    Signed-off-by: default avatarAlyssa Rosenzweig <alyssa@rosenzweig.io>
    Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
    Reviewed-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
    5d85a0a5