[LLVMdev] How to 'define and use' a LOOP intrinsic that takes "iteration count" and the "label" to jump to ?

RAVI KORSA ravi.korsa at gmail.com
Wed Feb 26 12:14:25 PST 2014


I have defined the intrinsic as
*  def int_loop: Intrinsic<[],[llvm_i8_ty, llvm_empty_ty],[]>;*

and also got the Codegen backend support in Instructioninfo.td file.

Then created a .ll file to test it.
The .ll file is like this









*declare void @llvm.loop(i8, label)define void @fn() nounwind readnone
{entry:   .....  .....  call void @llvm.loop(i8 10, label %entry)  ret
void}*

But when I run it with llc, I get the following error message

Intrinsic has incorrect argument type!
void (i8, label)* @llvm.loop
Broken module found, compilation aborted!

The 'Module Verifier' is complaining about the 'label' type. Any
suggestions on how I go about doing this ? Would appreciate your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140227/eb34d218/attachment.html>


More information about the llvm-dev mailing list