[LLVMdev] Question about inserting IR code

Qiuyu Zhang qiuyu at ucla.edu
Wed Jan 26 22:09:00 PST 2005


Hi,

From the file HowToUseJIT.cpp, I learned how to insert some calcuation IR code like Add/Sub/Mul etc by using 

  Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);

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

void llvm::BinaryOperator::init(llvm::Instruction::BinaryOps,
llvm::Value*, llvm::Value*): Assertion `getType()->isIntegral() && "Tried
to create an logical operation on a non-integral type!"' failed.

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.

BTW, allocaInst/storeInst/loadInst those works well for float point. 

Qiuyu



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050126/99e1044b/attachment.html>


More information about the llvm-dev mailing list