gemini-code-assist[bot] commented on code in PR #19956:
URL: https://github.com/apache/tvm/pull/19956#discussion_r3526354867
##########
src/s_tir/meta_schedule/postproc/rewrite_layout.cc:
##########
@@ -148,7 +148,7 @@ std::optional<std::tuple<SBlock, int, IndexMap>>
GetSuggestedIndexMap(
const auto& index_map = collector.GetBufferIndexMap();
- if (!index_map.defined() || !index_map) {
+ if (!index_map.has_value() || !index_map) {
Review Comment:

The condition `!index_map.has_value() || !index_map` is redundant because
`!index_map` evaluates to `!index_map.has_value()` via `operator bool()` on
`ffi::Optional`. This can be simplified to just `!index_map.has_value()`.
```suggestion
if (!index_map.has_value()) {
```
##########
src/s_tir/schedule/ir_comparator.cc:
##########
@@ -196,17 +196,17 @@ bool TensorizeComparator::VisitStmt_(const ForNode* op,
const Stmt& other) {
}
return false;
}
- if (op->thread_binding.defined() != rhs->thread_binding.defined()) {
+ if (op->thread_binding.has_value() != rhs->thread_binding.has_value()) {
if (assert_mode_) {
std::ostringstream os;
os << "ForNode thread_bindings do not match:
op->thread_binding.defined()="
- << op->thread_binding.defined()
- << " vs rhs->thread_binding.defined()=" <<
rhs->thread_binding.defined();
+ << op->thread_binding.has_value()
+ << " vs rhs->thread_binding.defined()=" <<
rhs->thread_binding.has_value();
Review Comment:

The error message still references `op->thread_binding.defined()` and
`rhs->thread_binding.defined()`. It should be updated to `has_value()` to match
the new API.
```suggestion
os << "ForNode thread_bindings do not match:
op->thread_binding.has_value()="
<< op->thread_binding.has_value()
<< " vs rhs->thread_binding.has_value()=" <<
rhs->thread_binding.has_value();
```
--
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]