<div dir="ltr">I used the following way to create an x86_sse2_sqrt_pd intrinsic instruction:<div><br></div><div><div>Value *Approx::CreateVFSqrt(IRBuilder<> &builder, Value *v, const std::string& Name) {</div><div>  Type *tys[] = {v->getType()};</div><div>  Module* M = currF->getParent();</div><div><br></div><div>  Value* sqrtv = Intrinsic::getDeclaration(M, Intrinsic::x86_sse2_sqrt_pd, tys);</div><div>  Value *CI = builder.CreateCall(sqrtv, v, Name);</div><div><br></div><div>  return CI;</div><div>}</div></div><div><br></div><div>I can compile it with clang++ and then generate the assembly code with llc.</div><div><br></div><div>However, it gives me and error "undefined reference to 'llvm.x86.sse2.sqrt.pd.v2f64'" when I want to generate the executable with gcc. BTW, I opened the assembly code and I can see an instruction "calll llvm.x86.sse2.sqrt.pd.v2f64" in the file. Any hint would be appreciated!</div><div><br></div><div>Best,</div><div>Zhi</div></div>