Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.2k
    • Issues 3.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1k
    • Merge requests 1k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MesaMesa
  • mesamesa
  • Merge requests
  • !1180

nir: Fix loop analysis for swizzling and bit sizes

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Faith Ekstrand requested to merge gfxstrand/mesa:review/nir-loop-analyze-swizzle into master Jun 25, 2019
  • Overview 21
  • Commits 12
  • Pipelines 7
  • Changes 5

When reviewing !1138 (closed), I realized that loop analysis was more broken than it looked on the surface. There are a lot of places where it crawls trees of ALU ops trying to detect such esoteric cases as ((a < b) && c) != 0 and all of that crawling code completely ignored swizzles. Most of the time, this isn't a problem because we get saved by scalarization. However, we still do use NIR loop analysis on vec4 shaders and you can't always be guaranteed that scalarization has happened yet. I was also reminded of another issue I'd seen before where we assume 32 bits all over the place so I cleaned that up while I was there.

The general approach to handling swizzles is to add a new nir_ssa_scalar struct which tracks a nir_ssa_value and an integer component. This struct then has various helpers for crawling ALU trees and converting to nir_const_value that do the right thing with the component. In theory, nir_loop_analyze should be pretty bullet-proof when it comes to this stuff now.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: review/nir-loop-analyze-swizzle