Skip to content

[Bug] Cannot find intrinsic declaration, possible type mismatch: llvm.log10 #17996

@Cookiee235

Description

@Cookiee235

Actual behavior

Traceback (most recent call last):
  File "/data/qshenaf/remote_pc/TirFuzz/bugs/topi.log10_2.py", line 8, in <module>
    tvm.build(sch.mod, target='llvm')
  File "/data/qshenaf/envs/tvm/python/tvm/driver/build_module.py", line 59, in build
    return tvm.tir.build(mod, target, pipeline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/python/tvm/tir/build.py", line 186, in build
    return tir_to_runtime(host_mod, device_mod_dict, target_host)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/python/tvm/tir/build.py", line 98, in tir_to_runtime
    mhost = codegen_build(mhost_all, target_host)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/python/tvm/tir/build.py", line 80, in codegen_build
    return bf(mod, target)
           ^^^^^^^^^^^^^^^
  File "tvm/_ffi/_cython/./packed_func.pxi", line 339, in tvm._ffi._cy3.core.PackedFuncBase.__call__
  File "tvm/_ffi/_cython/./packed_func.pxi", line 270, in tvm._ffi._cy3.core.FuncCall
  File "tvm/_ffi/_cython/./packed_func.pxi", line 259, in tvm._ffi._cy3.core.FuncCall3
  File "tvm/_ffi/_cython/./base.pxi", line 185, in tvm._ffi._cy3.core.CHECK_CALL
  File "/data/qshenaf/envs/tvm/python/tvm/_ffi/base.py", line 468, in raise_last_ffi_error
    raise py_err
  File "/data/qshenaf/envs/tvm/src/target/llvm/llvm_module.cc", line 620, in operator()
    n->Init(mod, target);
                ^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/llvm_module.cc", line 354, in tvm::codegen::LLVMModuleNode::Init(tvm::IRModule const&, tvm::Target const&)
    cg->AddFunctionsOrdered(mod->functions.begin(), mod->functions.end());
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.h", line 180, in void tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator)
    this->AddFunctionsOrdered(begin, end, [](auto f) { return f; });
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.h", line 644, in void tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator)::{lambda(auto:1)#1}>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator)::{lambda(auto:1)#1})
    AddFunction(gvar, func);
                  ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 232, in tvm::codegen::CodeGenCPU::AddFunction(tvm::GlobalVar const&, tvm::tir::PrimFunc const&)
    CodeGenLLVM::AddFunction(gvar, func);
                    ^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 223, in tvm::codegen::CodeGenLLVM::AddFunction(tvm::GlobalVar const&, tvm::tir::PrimFunc const&)
    this->AddFunctionInternal(gvar, f);
                    ^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 312, in tvm::codegen::CodeGenLLVM::AddFunctionInternal(tvm::GlobalVar const&, tvm::tir::PrimFunc const&)
    this->VisitStmt(f->body);
                    ^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2174, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
    VisitStmt(op->body);
                    ^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2174, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
    VisitStmt(op->body);
                    ^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2174, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
    VisitStmt(op->body);
                    ^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1131, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AttrStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                  ^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2118, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AttrStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2174, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
    VisitStmt(op->body);
                    ^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2174, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
    VisitStmt(op->body);
                    ^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2162, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1131, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AttrStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                  ^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2118, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AttrStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2168, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
    this->VisitStmt(stmt);
                  ^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2168, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
    this->VisitStmt(stmt);
                  ^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1089, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
    CodeGenLLVM::VisitStmt_(op);
                    ^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2125, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2174, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
    VisitStmt(op->body);
                    ^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2174, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
    VisitStmt(op->body);
                    ^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 2168, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
    this->VisitStmt(stmt);
                  ^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1099, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AttrStmtNode const*)
    this->CreateComputeScope(op);
                  ^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 578, in tvm::codegen::CodeGenCPU::CreateComputeScope(tvm::tir::AttrStmtNode const*)
    this->VisitStmt(op->body);
                    ^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1139, in tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::ForNode const*)
    CodeGenLLVM::VisitStmt_(op);
                  ^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 1989, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::ForNode const*)
    CreateSerialFor(MakeValue(op->min), MakeValue(op->extent),
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 873, in tvm::codegen::CodeGenLLVM::CreateSerialFor(llvm::Value*, llvm::Value*, llvm::Value*, tvm::tir::Var const&, tvm::tir::Stmt const&)
    this->VisitStmt(body);
                    ^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 1942, in tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::BufferStoreNode const*)
    llvm::Value* value = MakeValue(op->value);
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.h", line 192, in tvm::codegen::CodeGenLLVM::MakeValue(tvm::PrimExpr const&)
    llvm::Value* MakeValue(const PrimExpr& e) { return VisitExpr(e); }
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 1857, in tvm::codegen::CodeGenLLVM::VisitExpr_(tvm::tir::CallNode const*)
    auto x = CreateIntrinsic(op);
                ^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc", line 1059, in tvm::codegen::CodeGenCPU::CreateIntrinsic(tvm::tir::CallNode const*)
    return CodeGenLLVM::CreateIntrinsic(op);
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 1361, in tvm::codegen::CodeGenLLVM::CreateIntrinsic(tvm::tir::CallNode const*)
    ICHECK(f) << "Cannot find intrinsic declaration, possible type mismatch: "
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
tvm.error.InternalError: Traceback (most recent call last):
  81: operator()
        at /data/qshenaf/envs/tvm/src/target/llvm/llvm_module.cc:620
  80: tvm::codegen::LLVMModuleNode::Init(tvm::IRModule const&, tvm::Target const&)
        at /data/qshenaf/envs/tvm/src/target/llvm/llvm_module.cc:354
  79: void tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.h:180
  78: void tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator)::{lambda(auto:1)#1}>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::codegen::CodeGenLLVM::AddFunctionsOrdered<tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator>(tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator, tvm::runtime::Map<tvm::GlobalVar, tvm::BaseFunc, void, void>::iterator)::{lambda(auto:1)#1})
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.h:644
  77: tvm::codegen::CodeGenCPU::AddFunction(tvm::GlobalVar const&, tvm::tir::PrimFunc const&)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:232
  76: tvm::codegen::CodeGenLLVM::AddFunction(tvm::GlobalVar const&, tvm::tir::PrimFunc const&)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:223
  75: tvm::codegen::CodeGenLLVM::AddFunctionInternal(tvm::GlobalVar const&, tvm::tir::PrimFunc const&)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:312
  74: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  73: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  72: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  71: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  70: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  69: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  68: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2174
  67: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  66: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  65: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  64: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  63: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  62: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  61: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  60: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  59: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  58: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  57: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  56: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  55: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  54: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2174
  53: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  52: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2174
  51: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  50: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  49: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AttrStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1131
  48: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AttrStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2118
  47: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  46: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  45: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  44: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  43: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  42: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2174
  41: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  40: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2174
  39: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::LetStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2162
  38: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AttrStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1131
  37: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AttrStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2118
  36: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  35: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  34: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  33: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  32: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2168
  31: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  30: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  29: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  28: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  27: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  26: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  25: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  24: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  23: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  22: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  21: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2168
  20: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  19: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  18: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  17: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  16: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  15: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  14: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1089
  13: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::AssertStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2125
  12: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2174
  11: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::DeclBufferNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2174
  10: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::SeqStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:2168
  9: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::AttrStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1099
  8: tvm::codegen::CodeGenCPU::CreateComputeScope(tvm::tir::AttrStmtNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:578
  7: tvm::codegen::CodeGenCPU::VisitStmt_(tvm::tir::ForNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1139
  6: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::ForNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:1989
  5: tvm::codegen::CodeGenLLVM::CreateSerialFor(llvm::Value*, llvm::Value*, llvm::Value*, tvm::tir::Var const&, tvm::tir::Stmt const&)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:873
  4: tvm::codegen::CodeGenLLVM::VisitStmt_(tvm::tir::BufferStoreNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:1942
  3: tvm::codegen::CodeGenLLVM::MakeValue(tvm::PrimExpr const&)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.h:192
  2: tvm::codegen::CodeGenLLVM::VisitExpr_(tvm::tir::CallNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:1857
  1: tvm::codegen::CodeGenCPU::CreateIntrinsic(tvm::tir::CallNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_cpu.cc:1059
  0: tvm::codegen::CodeGenLLVM::CreateIntrinsic(tvm::tir::CallNode const*)
        at /data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc:1361
  File "/data/qshenaf/envs/tvm/src/target/llvm/codegen_llvm.cc", line 1361
InternalError: Check failed: (f) is false: Cannot find intrinsic declaration, possible type mismatch: llvm.log10

Environment

Any environment details, such as: Operating System, TVM version, etc

Steps to reproduce

import tvm
from tvm import te, topi, tir

x = te.placeholder((10,), dtype='int32', name='x')  # only support float, int32 will crash
op_output = topi.log10(x)

sch = tir.Schedule(te.create_prim_func([x, op_output]).with_attr('target', tvm.target.Target('llvm')))
tvm.build(sch.mod, target='llvm')

Triage

  • needs-triage
  • backend: llvm

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions