<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3821.2800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Times New Roman">Hi,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman">From the file HowToUseJIT.cpp, I learned how
to insert some calcuation IR code like Add/Sub/Mul etc by using </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman"> Instruction *Add =
BinaryOperator::createAdd(One, ArgX, "addresult", BB);</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">By following this way, it works well when I
insert some IR code whose operand is integer type like IntTy, however, when I
tried to insert similar thing whose operands are float point, I got the
following message when I run it</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">void
llvm::BinaryOperator::init(llvm::Instruction::BinaryOps,<BR>llvm::Value*,
llvm::Value*): Assertion `getType()->isIntegral() && "Tried<BR>to
create an logical operation on a non-integral type!"' failed.</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">It seems that I cannot insert float point type
operand by this way, right? If so, is there any way I can insert IR code whose
operand are float point. I am trying to find some else class (not
binaryOperator) to solve this problem, but I didn't make it.
Thanks.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman">BTW, allocaInst/storeInst/loadInst those works
well for float point. </FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">Qiuyu<BR><BR></DIV></FONT>
<DIV> </DIV></BODY></HTML>