@@ -109,10 +109,7 @@ LLVMInstruction *Lists::buildAppendToList(LLVMInstruction *ins)
109109 Compiler::StaticType type = m_utils.optimizeRegisterType (arg.second );
110110 LLVMListPtr &listPtr = m_utils.listPtr (ins->workList );
111111
112- Compiler::StaticType listType = Compiler::StaticType::Unknown;
113-
114- /* if (m_utils.warp())
115- listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
112+ Compiler::StaticType listType = ins->targetType ;
116113
117114 // Check if enough space is allocated
118115 llvm::Value *allocatedSize = m_builder.CreateLoad (m_builder.getInt64Ty (), listPtr.allocatedSizePtr );
@@ -151,10 +148,7 @@ LLVMInstruction *Lists::buildInsertToList(LLVMInstruction *ins)
151148 Compiler::StaticType type = m_utils.optimizeRegisterType (valueArg.second );
152149 LLVMListPtr &listPtr = m_utils.listPtr (ins->workList );
153150
154- Compiler::StaticType listType = Compiler::StaticType::Unknown;
155-
156- /* if (m_utils.warp())
157- listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
151+ Compiler::StaticType listType = ins->targetType ;
158152
159153 // Range check
160154 llvm::Value *size = m_builder.CreateLoad (m_builder.getInt64Ty (), listPtr.sizePtr );
@@ -189,10 +183,7 @@ LLVMInstruction *Lists::buildListReplace(LLVMInstruction *ins)
189183 Compiler::StaticType type = m_utils.optimizeRegisterType (valueArg.second );
190184 LLVMListPtr &listPtr = m_utils.listPtr (ins->workList );
191185
192- Compiler::StaticType listType = Compiler::StaticType::Unknown;
193-
194- /* if (m_utils.warp())
195- listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
186+ Compiler::StaticType listType = ins->targetType ;
196187
197188 // Range check
198189 llvm::Value *min = llvm::ConstantFP::get (llvmCtx, llvm::APFloat (0.0 ));
@@ -232,10 +223,7 @@ LLVMInstruction *Lists::buildGetListItem(LLVMInstruction *ins)
232223 const auto &arg = ins->args [0 ];
233224 LLVMListPtr &listPtr = m_utils.listPtr (ins->workList );
234225
235- Compiler::StaticType listType = Compiler::StaticType::Unknown;
236-
237- /* if (m_utils.warp())
238- listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
226+ Compiler::StaticType listType = ins->functionReturnReg ->type ();
239227
240228 llvm::Value *min = llvm::ConstantFP::get (m_utils.llvmCtx (), llvm::APFloat (0.0 ));
241229 llvm::Value *size = m_builder.CreateLoad (m_builder.getInt64Ty (), listPtr.sizePtr );
@@ -248,7 +236,6 @@ LLVMInstruction *Lists::buildGetListItem(LLVMInstruction *ins)
248236
249237 index = m_builder.CreateFPToUI (index, m_builder.getInt64Ty ());
250238 ins->functionReturnReg ->value = m_builder.CreateSelect (inRange, m_utils.getListItem (listPtr, index), null);
251- ins->functionReturnReg ->setType (listType);
252239
253240 return ins->next ;
254241}
@@ -269,10 +256,7 @@ LLVMInstruction *Lists::buildGetListItemIndex(LLVMInstruction *ins)
269256 const auto &arg = ins->args [0 ];
270257 LLVMListPtr &listPtr = m_utils.listPtr (ins->workList );
271258
272- Compiler::StaticType listType = Compiler::StaticType::Unknown;
273-
274- /* if (m_utils.warp())
275- listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
259+ Compiler::StaticType listType = ins->targetType ;
276260
277261 ins->functionReturnReg ->value = m_builder.CreateSIToFP (m_utils.getListItemIndex (listPtr, listType, arg.second ), m_builder.getDoubleTy ());
278262 return ins->next ;
@@ -284,10 +268,7 @@ LLVMInstruction *Lists::buildListContainsItem(LLVMInstruction *ins)
284268 const auto &arg = ins->args [0 ];
285269 LLVMListPtr &listPtr = m_utils.listPtr (ins->workList );
286270
287- Compiler::StaticType listType = Compiler::StaticType::Unknown;
288-
289- /* if (m_utils.warp())
290- listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
271+ Compiler::StaticType listType = ins->targetType ;
291272
292273 llvm::Value *index = m_utils.getListItemIndex (listPtr, listType, arg.second );
293274 ins->functionReturnReg ->value = m_builder.CreateICmpSGT (index, llvm::ConstantInt::get (m_builder.getInt64Ty (), -1 , true ));
0 commit comments