Skip to content

Commit 5cf8bfd

Browse files
committed
Add integer support to control instructions
1 parent f28ddd4 commit 5cf8bfd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/engine/internal/llvm/instructions/control.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ LLVMInstruction *Control::buildSelect(LLVMInstruction *ins)
9292
}
9393

9494
ins->functionReturnReg->value = m_builder.CreateSelect(cond, trueValue, falseValue);
95+
ins->functionReturnReg->isInt = m_builder.CreateSelect(cond, arg2.second->isInt, arg3.second->isInt);
96+
ins->functionReturnReg->intValue = m_builder.CreateSelect(cond, arg2.second->intValue, arg3.second->intValue);
9597
return ins->next;
9698
}
9799

@@ -245,6 +247,8 @@ LLVMInstruction *Control::buildLoopIndex(LLVMInstruction *ins)
245247
LLVMLoop &loop = m_utils.loops().back();
246248
llvm::Value *index = m_builder.CreateLoad(m_builder.getInt64Ty(), loop.index);
247249
ins->functionReturnReg->value = m_builder.CreateUIToFP(index, m_builder.getDoubleTy());
250+
ins->functionReturnReg->intValue = index;
251+
ins->functionReturnReg->isInt = m_builder.getInt1(true);
248252

249253
return ins->next;
250254
}

0 commit comments

Comments
 (0)