[IntrinsicLowering.cpp] How to use LowerIntrinsicCall(..) ?

Hi,

I’m currently trying to implement my own intrinsic that should be replaced as a function call. I saw the code in “CodeGen/IntrinsicLowering.cpp” and precisely the method LowerIntrinsicCall that handle, for example, the llvm.memcpy intrinsic. But, in “Target/X86/X86FastISel.cpp”, the intrinsic llvm.memcpy is also handled and lowered. I guess that “CodeGen/IntrinsicLowering.cpp” is a general approach that should work for every backend and the “Target/X86/X86FastISel.cpp” contains a specific, maybe faster, lowering implementation for the X86 target?

Unfortunately, my intrinsic lowering implementation in the function LowerIntrinsicCall of “CodeGen/IntrinsicLowering.cpp” is never called and Clang give me the following message:

“fatal error: error in backend: Cannot select: intrinsic %llvm.myintrinsic”

Any idea?

Thank you for your help,

Gaël