HomePhabricator
Diffusion Mesa 5d85a0a55b8c

nir: Implement optional b2f->iand lowering

Authored by Alyssa Rosenzweig <alyssa@rosenzweig.io> on May 2 2018, 4:04 AM.

Description

nir: Implement optional b2f->iand lowering

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: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>

Details

Committed
Christian Gmeiner <christian.gmeiner@gmail.com>May 18 2018, 10:44 PM
Pushed
pmoreauMay 22 2018, 7:03 PM
Parents
rMESA8ed2cabd04c4: travis: Adapt to radeonsi dropping support for LLVM 4
Branches
Unknown
Tags
Unknown

Event Timeline

Christian Gmeiner <christian.gmeiner@gmail.com> committed rMESA5d85a0a55b8c: nir: Implement optional b2f->iand lowering (authored by Alyssa Rosenzweig <alyssa@rosenzweig.io>).May 18 2018, 10:44 PM