1. 21 Feb, 2021 7 commits
  2. 20 Feb, 2021 4 commits
    • Mark Janes's avatar
      intel: check setuid before writing output file in INTEL_MEASURE · f54a65c6
      Mark Janes authored
      Without this check, the INTEL_MEASURE environment variable could be
      misused to overwrite arbitrary files.
      
      Fixes: 0f4143ec
      
       ("intel: Print GPU timing data based on INTEL_MEASURE")
      Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
      Part-of: <mesa/mesa!9166>
      f54a65c6
    • Ian Romanick's avatar
      nir/algebraic: Add some max/min optimizations with 3 variables · 3250e04d
      Ian Romanick authored
      
      
      Specifically, ARB assembly shaders with code like
      
          SLT    r0, r0, c[0].xxxx;
          ...
          KIL    r0.xyzx;
      
      can result in this pattern.  The other cases (e.g., 'KIL r0.xxxx' and
      'KIL r0.xyxx') are handled by existing patterns.
      Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      
      All Intel platforms had similar results. (Tiger Lake shown)
      total instructions in shared programs: 21050098 -> 21050065 (<.01%)
      instructions in affected programs: 2062 -> 2029 (-1.60%)
      helped: 31
      HURT: 1
      helped stats (abs) min: 1 max: 3 x̄: 1.10 x̃: 1
      helped stats (rel) min: 1.14% max: 4.35% x̄: 1.89% x̃: 1.69%
      HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
      HURT stats (rel)   min: 0.65% max: 0.65% x̄: 0.65% x̃: 0.65%
      95% mean confidence interval for instructions value: -1.23 -0.84
      95% mean confidence interval for instructions %-change: -2.12% -1.50%
      Instructions are helped.
      
      total cycles in shared programs: 855105466 -> 855105055 (<.01%)
      cycles in affected programs: 50136 -> 49725 (-0.82%)
      helped: 33
      HURT: 0
      helped stats (abs) min: 3 max: 22 x̄: 12.45 x̃: 12
      helped stats (rel) min: 0.13% max: 1.57% x̄: 0.86% x̃: 0.92%
      95% mean confidence interval for cycles value: -13.78 -11.13
      95% mean confidence interval for cycles %-change: -0.97% -0.76%
      Cycles are helped.
      
      No fossil-db changes on any Intel platform.
      
      Part-of: <mesa/mesa!9122>
      3250e04d
    • Ian Romanick's avatar
      nir/algebraic: Remove some redundant b2f logic-op reduction patterns · d9b5bce8
      Ian Romanick authored
      
      
      There are patterns that will re-write the fmin or fmax part into a form
      that other patterns will gradually convert to the same ior or iand.  For
      example,
      
          fmax(b2f(a), b2f(b)) != 0
          b2f(a || b) != 0
          a || b
      
      No shader-db or fossil-db changes on any Intel platform.
      Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      Part-of: <mesa/mesa!9122>
      d9b5bce8
    • Ian Romanick's avatar
      nir/algebraic: Fix some min/max of b2f replacements · 7e127c1f
      Ian Romanick authored
      fmin(-A, -B) is -fmax(A, B), and fmax(-A, -B) is -fmin(A, B).  Therefore
      the logic joining A and B should toggle between ior and iand for the
      negated versions.
      
      At the very least, a shader from Euro Truck Simulator 2 in shader-db is
      affected by this.  The KIL instruction in the (ARB assembly) shader ends
      up with the wrong logic.  This is _probably_ the source of
      mesa/mesa#1346.
      
      That said, the issue mentions that Mesa 18.0.5 works, but commit
      68420d83 ("nir: Simplify min and max of b2f") was added in 17.3.
      Moreover, I was not able to reproduce the error in the ETS2 shader from
      shader-db from any Mesa commit near the time the original fd.o bugzilla
      was submitted (December 2018). 🤷
      
      In fact, the current error in that shader starts with 9167324a
      ("nir/algebraic: Mark some logic-joined comparison reductions as
      exact").  That's a bit of a red herring as 9167324a just sets off a
      chain of replacements that eventually leads to the incorrect min/max of
      b2f patterns fixed by this commit.
      
      The other affected shaders in the shader-db results are from Cargo
      Commander.  These are also ARB assembly shaders.
      
      I think any ARB assembly shader that uses the pattern
      
          SLT    r0, ...;
          ...
          KIL    -r0;
      
      will suffer from issues related to this.
      
      This change fixes the piglit
      tests/spec/arb_fragment_program/kil-of-slt.shader_test test added in
      mesa/piglit!454.
      
      shader-db results:
      
      All Gen6+ platforms had similar result. (Ice Lake shown)
      total instructions in shared programs: 20034604 -> 20034486 (<.01%)
      instructions in affected programs: 3885 -> 3767 (-3.04%)
      helped: 47
      HURT: 2
      helped stats (abs) min: 2 max: 4 x̄: 2.64 x̃: 2
      helped stats (rel) min: 2.33% max: 8.33% x̄: 3.48% x̃: 3.39%
      HURT stats (abs)   min: 3 max: 3 x̄: 3.00 x̃: 3
      HURT stats (rel)   min: 13.64% max: 16.67% x̄: 15.15% x̃: 15.15%
      95% mean confidence interval for instructions value: -2.83 -1.99
      95% mean confidence interval for instructions %-change: -3.84% -1.60%
      Instructions are helped.
      
      total cycles in shared programs: 979881379 -> 979879406 (<.01%)
      cycles in affected programs: 119873 -> 117900 (-1.65%)
      helped: 46
      HURT: 3
      helped stats (abs) min: 10 max: 756 x̄: 45.41 x̃: 26
      helped stats (rel) min: 0.53% max: 19.72% x̄: 1.67% x̃: 1.26%
      HURT stats (abs)   min: 28 max: 56 x̄: 38.67 x̃: 32
      HURT stats (rel)   min: 1.44% max: 3.54% x̄: 2.75% x̃: 3.27%
      95% mean confidence interval for cycles value: -70.83 -9.70
      95% mean confidence interval for cycles %-change: -2.23% -0.57%
      Cycles are helped.
      
      Iron Lake and GM45 had similar results. (Iron Lake shown)
      total instructions in shared programs: 8115098 -> 8115076 (<.01%)
      instructions in affected programs: 2592 -> 2570 (-0.85%)
      helped: 32
      HURT: 2
      helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
      helped stats (rel) min: 0.88% max: 2.70% x̄: 1.35% x̃: 1.31%
      HURT stats (abs)   min: 5 max: 5 x̄: 5.00 x̃: 5
      HURT stats (rel)   min: 17.24% max: 18.52% x̄: 17.88% x̃: 17.88%
      95% mean confidence interval for instructions value: -1.15 -0.15
      95% mean confidence interval for instructions %-change: -1.83% 1.39%
      Inconclusive result (%-change mean confidence interval includes 0).
      
      total cycles in shared programs: 238189718 -> 238189802 (<.01%)
      cycles in affected programs: 75076 -> 75160 (0.11%)
      helped: 3
      HURT: 31
      helped stats (abs) min: 2 max: 130 x̄: 44.67 x̃: 2
      helped stats (rel) min: 0.18% max: 5.70% x̄: 2.02% x̃: 0.19%
      HURT stats (abs)   min: 2 max: 70 x̄: 7.03 x̃: 4
      HURT stats (rel)   min: 0.07% max: 6.41% x̄: 0.53% x̃: 0.15%
      95% mean confidence interval for cycles value: -7.27 12.21
      95% mean confidence interval for cycles %-change: -0.33% 0.94%
      Inconclusive result (value mean confidence interval includes 0).
      
      No fossil-db changes on any Intel platform.
      
      Fixes: 68420d83
      
       ("nir: Simplify min and max of b2f")
      Closes: #1346
      Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      Part-of: <mesa/mesa!9122>
      7e127c1f
  3. 19 Feb, 2021 29 commits