changed spir generation to include metadata