Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,055
    • Issues 3,055
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1,002
    • Merge requests 1,002
  • 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
  • !10322

microsoft/clc: Significant compiler interface re-work

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jesse Natalie requested to merge jenatali/mesa:clon12-compiler-rework into main Apr 19, 2021
  • Overview 2
  • Commits 9
  • Pipelines 8
  • Changes 10

The primary goal of this series is to enable CLOn12 to support SPIR and SPIR-V, including specialization constants. The secondary goal is some cleanup.

This series accomplishes the following:

  • Fix the name of the compiler binary produced. I had aspirations of sharing compiler infrastructure between OpenCL and OpenGL, but I doubt that's going to happen in the long run, so let's just fix the name and drop "GL".
  • Rename some entrypoints and structures to be more specific about what they do/are (e.g. "compile C to SPIR-V" instead of just "compile"). This helps reduce ambiguity when adding support for SPIR. Split SPIR-V binary data and metadata into two separate structs, and make metadata parsing explicit rather than part of linking.
  • Since this is already going to be an API/ABI break, clean up some ugliness - since SPIR-V, metadata, and DXIL are already transparent structs, don't have the compiler DLL heap-allocated them, let the caller allocate them how they want (e.g. embedded in a larger object).
  • Support serializing/deserializing LLVM IR (SPIR) to support cl_khr_spir.
  • Support parsing externally-provided SPIR-V, including parsing specialization constants and providing that as output metadata, and handle/report errors from parsing (which never should've happened previously since we generated it ourselves).
  • Support specializing SPIR-V, either during translation to NIR, or as an explicit specialize step (needed to support independent compilation and linking with spec constants).

The corresponding OpenCLOn12 change is https://github.com/microsoft/OpenCLOn12/pull/21. This adds SPIR-V IL support and not yet SPIR, but that'll be coming as well.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: clon12-compiler-rework