Skip to content

Spir to ir tool branch #5175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed

Conversation

mdtoguchi
Copy link
Contributor

No description provided.

Tool name:
  spir-to-ir

Function:
  Provides an interface used within the compiler driver toolchain which
  converts SPIR-V to LLVM-IR.  Using llvm-spirv as the main conversion
  tool, the purpose of this is to be able to take binaries and convert
  them to LLVM-IR.  The conversion only takes place if the input is
  SPIR-V, and if the LLVM-IR is provided it is simply copied and
  passed through.

  This tool is useful for handling generated fat objects/archives that
  contain SPIR-V as opposed to typical LLVM-IR.  We do not now the
  type of files within the device objects, so we use this tool to make
  sure that file consumed after unbundling is always LLVM-IR.

Example usage:
  spir-to-ir input.spv -o output.bc  // creates LLVM-IR output.bc
  spir-to-ir input.bc -o output.bc   // no conversion, creates output.bc
When a user creates objects/archives based off of -fsycl-device-obj=spirv
we want to be able to consume these objects seamlessly.  After any objects
are unbundled, we will pass these through spir-to-ir-wrapper to potentially
convert them to LLVM-IR before performing the device link.

Toolchain flow will resemble:

          fat object
              |
           unbundle
              |
      +-------+------+
      |              |
  spir-to-ir         |
      |              |
  llvm-link          |
      |              |
    wrap             |
      |              |
      +-------+------+
              |
             link
@mdtoguchi mdtoguchi requested a review from AGindinson December 18, 2021 01:39
@mdtoguchi
Copy link
Contributor Author

@AGindinson, I wanted to get this up so you can take a look at what I'm trying to do. I haven't made any adjustments to tests yet so I know those need to be updated.

@mdtoguchi
Copy link
Contributor Author

Closing this one in favor of: #5251

@mdtoguchi mdtoguchi closed this Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant