gemini-code-assist[bot] commented on code in PR #18508:
URL: https://github.com/apache/tvm/pull/18508#discussion_r2563242835
##########
src/tir/schedule/primitive/compute_inline.cc:
##########
@@ -1090,10 +1112,40 @@ bool
ReductionEpilogueFuser::AnalyzeEpiloguePattern(const PrimExpr& value) {
// Ensure exactly one operand is from the reduction buffer
if (a_is_target != b_is_target) {
epilogue_addend_ = a_is_target ? add->b : add->a;
+ epilogue_type_ = EpilogueType::Bias;
return true;
}
}
+ // Pattern 2: max(temp[i,j] + C[i,j], 0) or max(C[i,j] + temp[i,j], 0)
(BiasReLU)
+ if (const auto* max_node = value.as<MaxNode>()) {
+ // Check if second operand is zero (ReLU: max(x, 0))
+ // Support both integer and float zero constants
+ bool is_zero_const = false;
+ if (tir::is_zero(max_node->b)) {
+ is_zero_const = true;
+ } else if (const auto* float_imm = max_node->b.as<FloatImmNode>()) {
+ is_zero_const = (float_imm->value == 0.0);
+ }
Review Comment:

The `tir::is_zero` function handles both integer and floating-point zero
constants, so the `else if` condition checking for `FloatImmNode` is redundant.
This check can be simplified.
```suggestion
bool is_zero_const = tir::is_zero(max_node->b);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]