1. 29 May, 2019 1 commit
    • Caio Oliveira's avatar
      nir: Allow derefs to be used as phi sources · 8bdf5a00
      Caio Oliveira authored
      
      
      It is possible and valid for a pointer to be selected based on a
      conditional before used, and depending on the mode, those cases will
      result in a phi with derefs as sources.
      
      To achieve this, we don't rematerialize derefs that are used by phis.
      As a consequence, when converting from SSA to regs, we may have phis
      that come from different blocks and are used by phis.  We now convert
      those to regs too.
      
      Validation was added to ensure only derefs of certain modes can be
      used as phi sources.  No extra validation is needed for the presence
      of cast, any instruction that uses derefs will validate the
      deref-chain is complete (ending in a cast or a var).
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      8bdf5a00
  2. 19 Apr, 2019 2 commits
  3. 28 Mar, 2019 1 commit
    • Dave Airlie's avatar
      nir/deref: fix struct wrapper casts. (v3) · b779baa9
      Dave Airlie authored
      
      
      llvm/spir-v spits out some struct a { struct b {} }, but it
      doesn't deref, it casts (struct a) to (struct b), reconstruct
      struct derefs instead of casts for these.
      
      v2: use ssa_def_rewrite uses, rework the type restrictions (Jason)
      v3: squish more stuff into one function, drop unused temp (Jason)
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      b779baa9
  4. 21 Mar, 2019 1 commit
  5. 15 Mar, 2019 1 commit
  6. 06 Mar, 2019 2 commits
  7. 11 Feb, 2019 1 commit
    • Jason Ekstrand's avatar
      nir/deref: Rematerialize parents in rematerialize_derefs_in_use_blocks · 9e6a6ef0
      Jason Ekstrand authored
      When nir_rematerialize_derefs_in_use_blocks_impl was first written, I
      attempted to optimize things a bit by not bothering to re-materialize
      the sources of deref instructions figuring that the final caller would
      take care of that.  However, in the case of more complex deref chains
      where the first link or two lives in block A and then another link and
      the load/store_deref intrinsic live in block B it doesn't work.  The
      code in rematerialize_deref_in_block looks at the tail of the chain,
      sees that it's already in block B and skips it, not realizing that part
      of the chain also lives in block A.
      
      The easy solution here is to just rematerialize deref sources of deref
      instructions as well.  This may potentially lead to a few more deref
      instructions being created by the conditions required for that to
      actually happen are fairly unlikely and, thanks to the caching, it's all
      linear time regardless.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109603
      Fixes: 7d1d1208
      
       "nir: Add a small pass to rematerialize derefs per-block"
      Reviewed-by: Alejandro Piñeiro's avatarAlejandro Piñeiro <apinheiro@igalia.com>
      9e6a6ef0
  8. 05 Feb, 2019 1 commit
  9. 26 Jan, 2019 1 commit
  10. 14 Jan, 2019 1 commit
  11. 10 Jan, 2019 1 commit
    • Matt Turner's avatar
      nir: Unset metadata debug bit if no progress made · 26236531
      Matt Turner authored
      
      
      NIR metadata validation verifies that the debug bit was unset (by a call
      to nir_metadata_preserve) if a NIR optimization pass made progress on
      the shader. With the expectation that the NIR shader consists of only a
      single main function, it has been safe to call nir_metadata_preserve()
      iff progress was made.
      
      However, most optimization passes calculate progress per-function and
      then return the union of those calculations. In the case that an
      optimization pass makes progress only on a subset of the functions in
      the shader metadata validation will detect the debug bit is still set on
      any unchanged functions resulting in a failed assertion.
      
      This patch offers a quick solution (short of a larger scale refactoring
      which I do not wish to undertake as part of this series) that simply
      unsets the debug bit on unchanged functions.
      Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      26236531
  12. 08 Jan, 2019 6 commits
  13. 28 Nov, 2018 1 commit
  14. 22 Oct, 2018 1 commit
  15. 19 Sep, 2018 2 commits
  16. 28 Aug, 2018 1 commit
  17. 22 Aug, 2018 2 commits
  18. 02 Jul, 2018 2 commits
  19. 23 Jun, 2018 6 commits