This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Add a pass to unify aliased resource variables
ClosedPublic

Authored by antiagainst on Feb 15 2022, 11:38 AM.

Details

Summary

In SPIR-V, resources are represented as global variables that
are bound to certain descriptor. SPIR-V requires those global
variables to be declared as aliased if multiple ones are bound
to the same slot. Such aliased decorations can cause issues
for transcompilers like SPIRV-Cross when converting to source
shading languages like MSL.

So this commit adds a pass to perform analysis of aliased
resources and see if we can unify them into one.

Diff Detail

Event Timeline

antiagainst created this revision.Feb 15 2022, 11:38 AM
antiagainst requested review of this revision.Feb 15 2022, 11:38 AM
ThomasRaoux accepted this revision.Feb 16 2022, 11:03 AM
This revision is now accepted and ready to land.Feb 16 2022, 11:03 AM