" Instruction does not dominate all uses" is not a new issue since in unity branch, more strict check has merged in codegen_llvm.cc(see following this->Verify()): tvm/src/target/llvm/codegen_llvm.cc at main · apache/tvm (github.com)
std::unique_ptr<llvm::Module> CodeGenLLVM::Finish() {
this->AddStartupFunction();
for (size_t i = 0; i < link_modules_.size(); ++i) {
ICHECK(!llvm::Linker::linkModules(*module_, std::move(link_modules_[i])))
<< "Failed to link modules";
}
link_modules_.clear();
this->Verify();
this->Optimize();
this->Verify();
return std::move(module_);
}
not only RoCM target, but alse other amd-likes target may occur same kind of issue. part of compile error may likes:
TVMError: LLVM module verification failed with the following errors:
Instruction does not dominate all uses!
%27 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
%47 = and i32 %27, 15
Instruction does not dominate all uses!
%27 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
%49 = ashr i32 %27, 4
Instruction does not dominate all uses!
%27 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
%60 = add nsw i32 %59, %27
Instruction does not dominate all uses!
%27 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
%202 = add nsw i32 %201, %27
Instruction does not dominate all uses!
%27 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
%206 = and i32 %27, 15
Instruction does not dominate all uses!
%27 = call i32 @llvm.nvvm.read.ptx.sreg.tid.x()
%209 = ashr i32 %27, 4