Skip to content

Commit

Permalink
[Bugfix][ROCm] Handle tvm_thread_invariant in ROCm backend
Browse files Browse the repository at this point in the history
PR apache#16345 introduced a TIR intrinsic `tvm_thread_invariant` as a no-op
intrinsic that indicates that a condition is an invariant across
threads. It is a necessary change to support MoE group GEMM operations.

However, we noticed that the LLVM-ROCm backend has been broken since
then because this no-op intrinsic hasn't been properly handled in this
particular backend. This PR fixes this behavior by checking this no-op
in the LLVM backend.
  • Loading branch information
junrushao committed Jan 15, 2024
1 parent cf14edd commit d8d6705
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/target/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,8 @@ llvm::Value* CodeGenLLVM::CreateIntrinsic(const CallNode* op) {
} else if (op->op.same_as(builtin::assume())) {
llvm::Value* cond = MakeValue(op->args[0]);
return builder_->CreateAssumption(cond);
} else if (op->op.same_as(builtin::tvm_thread_invariant())) {
return MakeValue(op->args[0]);
} else {
LOG(FATAL) << "unknown intrinsic " << op->op;
}
Expand Down

0 comments on commit d8d6705

Please sign in to comment.