Store phi variables in a collection of SIMD components

Previously the components of phi variables were stored as Reactor
arrays, but this isn't necessary since phis aren't dynamically
indexable. They can instead be stored as individual components.

This avoids spending time in the scalar-replacement-of-aggregates (SROA)
optimizaton pass.

Bug: b/229968910
Change-Id: Ib0ccb16139f1421858b47d8555e3a9479dca5d83
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/68750
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp
index 08ebc52..b026e93 100644
--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -1853,7 +1853,7 @@
 		if(insn.opcode() == spv::OpPhi)
 		{
 			auto type = shader.getType(insn.resultTypeId());
-			state.phis.emplace(insn.resultId(), Array<SIMD::Float>(type.componentCount));
+			state.phis.emplace(insn.resultId(), std::vector<SIMD::Float>(type.componentCount));
 		}
 	}
 
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp
index 2a40a53..740f6ba 100644
--- a/src/Pipeline/SpirvShader.hpp
+++ b/src/Pipeline/SpirvShader.hpp
@@ -1525,7 +1525,7 @@
 	const vk::DescriptorSet::Bindings &descriptorSets;
 
 	std::unordered_map<Object::ID, Intermediate> intermediates;
-	std::unordered_map<Object::ID, Array<SIMD::Float>> phis;
+	std::unordered_map<Object::ID, std::vector<SIMD::Float>> phis;
 	std::unordered_map<Object::ID, SIMD::Pointer> pointers;
 	std::unordered_map<Object::ID, SampledImagePointer> sampledImages;
 
diff --git a/src/Pipeline/SpirvShaderControlFlow.cpp b/src/Pipeline/SpirvShaderControlFlow.cpp
index 5783724..dc17a71 100644
--- a/src/Pipeline/SpirvShaderControlFlow.cpp
+++ b/src/Pipeline/SpirvShaderControlFlow.cpp
@@ -681,7 +681,7 @@
 
 	auto storageIt = phis.find(objectId);
 	ASSERT(storageIt != phis.end());
-	auto &storage = storageIt->second;
+	const auto &storage = storageIt->second;
 
 	auto &dst = createIntermediate(objectId, type.componentCount);
 	for(uint32_t i = 0; i < type.componentCount; i++)