[LLVMdev] Can't invoke an intrinsic?

Talin viridia at gmail.com
Sat Apr 26 20:21:10 PDT 2008

In line 1157 of Verifier.cpp, there is this code:

      Assert1(!F->isIntrinsic() || (i == 0 && isa<CallInst>(I)),
              "Cannot take the address of an intrinsic!", &I);

This check appears to have a problem with this line:

        invoke void @llvm.memcpy.i32( i8* %._items.i.i, i8* 
%._items2.i.i, i32 ptrtoint (i32* getelementptr ([0 x i32]* null, i32 0, 
i32 4) to i32), i32 1 )
                        to label %UnifiedReturnBlock unwind label %failure

...in other words, it appears to be implying that it's not OK to use 
'invoke' on an intrinsic. Is that correct?

I should mention also that the code snipped above was produced by LLVM's 
optimizer, in my original code the call to memcpy was a call, not an 
invoke. So if it is indeed illegal to invoke intrinsics, the optimizer 
should be informed of this fact :)

-- Talin

More information about the llvm-dev mailing list