Skip to content
  • Faith Ekstrand's avatar
    nir: Add a pass for lowering integer division by constants · 74492eba
    Faith Ekstrand authored
    
    
    It's a reasonably well-known fact in the world of compilers that integer
    divisions by constants can be replaced by a multiply, an add, and some
    shifts.  This commit adds such an optimization to NIR for easiest case
    of udiv.  Other division operations will be added in following commits.
    In order to provide some additional driver control, the pass takes a
    minimum bit size to optimize.
    
    Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
    74492eba