commit | 3eeed90f7f73eac8d83e25c4ba756f5164c0600f | [log] [tgz] |
---|---|---|
author | Lei Zhang <antiagainst@google.com> | Wed Jul 28 14:07:47 2021 -0400 |
committer | GitHub <noreply@github.com> | Wed Jul 28 11:07:47 2021 -0700 |
tree | a3548401b893aa9853d1edd58e191062946e1ba1 | |
parent | 47238df8198e06fcaf41858114fdac5d6c1ba4dc [diff] |
[spirv] Create variables early for conversion and deduplication (#6574) `hal.interface.binding.subspan` to `spv.GlobalVariable` conversion is tricky due to their different scopes (function vs. module), SSA values vs. symbols, and the need to attach `alias` decorations. Previously we create `spv.GlobalVariable` in the middle of the conversion procedure, it requires us to pass down a few data structures to the pattern so that we can access the alias status. Notably, it requires us to pass in a `SymbolTable` so that we can unique symbols. The `SymbolTable` needs to be created before the conversion; otherwise we will see errors. It's relying on `SymbolTable` and conversion framework implementation details; so quite opaque. This commit changes to create the global variables earlier, at the alias analysis step. Then during conversion, we just need to look up the table and perform mechanical rewrite, plus type fixup. This limits all the `SymbolTable` access to a much smaller scope. More importantly, we can also perform some deduplication for created global variables to generate smaller SPIR-V blobs.
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
IREE is still in its early phase. We have settled down on the overarching infrastructure and are actively improving various software components as well as project logistics. It is still quite far from ready for everyday use and is made available without any support at the moment. With that said, we welcome any kind of feedback on any communication channels!
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.