|
@@ -4845,7 +4845,7 @@ Value *SROA_Parameter_HLSL::castArgumentIfRequired(
|
|
V = Builder.CreateExtractElement(OldV, (uint64_t)0);
|
|
V = Builder.CreateExtractElement(OldV, (uint64_t)0);
|
|
vectorEltsMap[V].emplace_back(V);
|
|
vectorEltsMap[V].emplace_back(V);
|
|
for (unsigned i = 1; i < vecSize; i++) {
|
|
for (unsigned i = 1; i < vecSize; i++) {
|
|
- Value *Elt = Builder.CreateExtractElement(OldV, (uint64_t)0);
|
|
|
|
|
|
+ Value *Elt = Builder.CreateExtractElement(OldV, i);
|
|
vectorEltsMap[V].emplace_back(Elt);
|
|
vectorEltsMap[V].emplace_back(Elt);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -5538,6 +5538,9 @@ void SROA_Parameter_HLSL::createFlattenedFunction(Function *F) {
|
|
if (F->getReturnType()->isVoidTy() && F->getArgumentList().empty()) {
|
|
if (F->getReturnType()->isVoidTy() && F->getArgumentList().empty()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ // Clear maps for cast.
|
|
|
|
+ castParamMap.clear();
|
|
|
|
+ vectorEltsMap.clear();
|
|
|
|
|
|
DxilFunctionAnnotation *funcAnnotation = m_pHLModule->GetFunctionAnnotation(F);
|
|
DxilFunctionAnnotation *funcAnnotation = m_pHLModule->GetFunctionAnnotation(F);
|
|
DXASSERT(funcAnnotation, "must find annotation for function");
|
|
DXASSERT(funcAnnotation, "must find annotation for function");
|
|
@@ -5797,6 +5800,10 @@ void SROA_Parameter_HLSL::createFlattenedFunctionCall(Function *F, Function *fla
|
|
DxilFunctionAnnotation *funcAnnotation = m_pHLModule->GetFunctionAnnotation(F);
|
|
DxilFunctionAnnotation *funcAnnotation = m_pHLModule->GetFunctionAnnotation(F);
|
|
DXASSERT(funcAnnotation, "must find annotation for function");
|
|
DXASSERT(funcAnnotation, "must find annotation for function");
|
|
|
|
|
|
|
|
+ // Clear maps for cast.
|
|
|
|
+ castParamMap.clear();
|
|
|
|
+ vectorEltsMap.clear();
|
|
|
|
+
|
|
DxilTypeSystem &typeSys = m_pHLModule->GetTypeSystem();
|
|
DxilTypeSystem &typeSys = m_pHLModule->GetTypeSystem();
|
|
|
|
|
|
std::vector<Value *> FlatParamList;
|
|
std::vector<Value *> FlatParamList;
|