At the moment, the current SPIR-V back-end uses an exta pass, which results in increased and (probably) unnecessary memory.
After everything is parsed, it then rearranges all the data in the correct order for the Physical- and Logical Layout.
A better and proposed way of @kvark is just single passing it. This means stripping the phase of rearranging, and holding data in temporarily vectors, to just directly write it to the output string.
There will be some lightweight "scans" through the IR to look for example the Capabilities the SPIR-V output requires, but this shouldn't be a whole lot of iterations.
At the moment, the current SPIR-V back-end uses an exta pass, which results in increased and (probably) unnecessary memory.
After everything is parsed, it then rearranges all the data in the correct order for the Physical- and Logical Layout.
A better and proposed way of @kvark is just single passing it. This means stripping the phase of rearranging, and holding data in temporarily vectors, to just directly write it to the output string.
There will be some lightweight "scans" through the IR to look for example the Capabilities the SPIR-V output requires, but this shouldn't be a whole lot of iterations.