Tvm build error: ‘x86_vcvtph2ps_256’ is not a member of ‘llvm::Intrinsic’

Hi.

I got this issue:

/home/nvidia/tvm/src/target/llvm/codegen_x86_64.cc: In member function ‘virtual llvm::Value* tvm::codegen::CodeGenX86_64::VisitExpr_(const tvm::tir::CastNode*)’: /home/nvidia/tvm/src/target/llvm/codegen_x86_64.cc:106:30: error: ‘x86_vcvtph2ps_256’ is not a member of ‘llvm::Intrinsic’ ::llvm::Intrinsic::x86_vcvtph2ps_256, 8, LLVMType(DataType::Float(32, from.lanes())), ^~~~~~~~~~~~~~~~~ /home/nvidia/tvm/src/target/llvm/codegen_x86_64.cc:106:30: note: suggested alternative: ‘x86_vcvtps2ph_256’ ::llvm::Intrinsic::x86_vcvtph2ps_256, 8, LLVMType(DataType::Float(32, from.lanes())), ^~~~~~~~~~~~~~~~~ x86_vcvtps2ph_256 CMakeFiles/tvm.dir/build.make:5702: recipe for target ‘CMakeFiles/tvm.dir/src/target/llvm/codegen_x86_64.cc.o’ failed

while build tvm from source as tutorial https://docs.tvm.ai/install/from_source.html

My cmake config is set CUDA & LLVM ON.

My LLVM is built from source (v11.0).

Currently i don’t know how to fix this error. Please help !!!

Many thanks.

I ran into the same problem. In, /home/nvidia/tvm/src/target/llvm/codegen_x86_64.cc:106, replace ‘x86_vcvtph2ps_256’ with ‘x86_vcvtps2ph_256’.

1 Like

Comment out that part of the code. This intrinsic has been removed from LLVM.

1 Like

Those are conversions in opposite directions.

1 Like

Thank mileslaw and kparzysz,

Is there any problem if we use ‘x86_vcvtps2ph_256’ instead of ‘x86_vcvtph2ps_256’ ?

Many thanks

If that code executes, it’ll give an incorrect answer. I think it’ll actually crash in codegen because of type mismatch.

Dear kparzysz,

  1. Is it ok if I comment all of the code related to this intrinsic::x86_vcvtph2ps_256 ?

  2. This issue happened with the LLVM 10.0 , should I downgrade LLVM to avoid this issue ?

I found out the problem that llvm lastest source is 11.0 and this value is no longer in used but our TVM latest source is still based on llvm 10.0… So reduce llvm version to 10.0 it works.

Thank kparzysz and mileslaw !