Skip to content
  • Ian Romanick's avatar
    nir/range-analysis: Adjust result range of multiplication to account for flush-to-zero · 97e44d68
    Ian Romanick authored and Dylan Baker's avatar Dylan Baker committed
    Fixes piglit tests (new in piglit!110):
    
        - fs-underflow-fma-compare-zero.shader_test
        - fs-underflow-mul-compare-zero.shader_test
    
    v2: Add back part of comment accidentally deleted.  Noticed by
    Caio. Remove is_not_zero function as it is no longer used.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111308
    Fixes: fa116ce3 ("nir/range-analysis: Range tracking for ffma and flrp")
    Fixes: 405de7cc
    
     ("nir/range-analysis: Rudimentary value range analysis pass")
    Reviewed-by: default avatarCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
    
    All Gen7+ platforms** had similar results. (Ice Lake shown)
    total instructions in shared programs: 16278465 -> 16279492 (<.01%)
    instructions in affected programs: 16765 -> 17792 (6.13%)
    helped: 0
    HURT: 23
    HURT stats (abs)   min: 7 max: 275 x̄: 44.65 x̃: 8
    HURT stats (rel)   min: 1.15% max: 17.51% x̄: 4.23% x̃: 1.62%
    95% mean confidence interval for instructions value: 9.57 79.74
    95% mean confidence interval for instructions %-change: 1.85% 6.61%
    Instructions are HURT.
    
    total cycles in shared programs: 367135159 -> 367154270 (<.01%)
    cycles in affected programs: 279306 -> 298417 (6.84%)
    helped: 0
    HURT: 23
    HURT stats (abs)   min: 13 max: 6029 x̄: 830.91 x̃: 54
    HURT stats (rel)   min: 0.17% max: 45.67% x̄: 7.33% x̃: 0.49%
    95% mean confidence interval for cycles value: 100.89 1560.94
    95% mean confidence interval for cycles %-change: 0.94% 13.71%
    Cycles are HURT.
    
    total spills in shared programs: 8870 -> 8869 (-0.01%)
    spills in affected programs: 19 -> 18 (-5.26%)
    helped: 1
    HURT: 0
    
    total fills in shared programs: 21904 -> 21901 (-0.01%)
    fills in affected programs: 81 -> 78 (-3.70%)
    helped: 1
    HURT: 0
    
    LOST:   0
    GAINED: 1
    
    ** On Broadwell, a shader was hurt for spills / fills instead of
       helped.
    
    No changes on any earlier platforms.
    
    (cherry picked from commit ef2e2352)
    97e44d68