Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions paddle/cinn/optim/simplify_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,14 @@ ir::IndexExpr::IndexType VerifyIndex(const ir::Expr &expr) {
: ir::IndexExpr::IndexType::kInvalid;
}
case ir::IrNodeTy::Load: {
return expr.type().is_index_type() ? ir::IndexExpr::IndexType::kLoad
: ir::IndexExpr::IndexType::kInvalid;
if (!expr.type().is_index_type())
return ir::IndexExpr::IndexType::kInvalid;
auto load = expr.As<ir::Load>();
for (const auto &indices : load->indices) {
if (VerifyIndex(indices) == ir::IndexExpr::IndexType::kInvalid)
return ir::IndexExpr::IndexType::kInvalid;
}
return ir::IndexExpr::IndexType::kLoad;
}
case ir::IrNodeTy::Cast: {
ir::IndexExpr::IndexType result = VerifyIndex(expr->operand(0));
Expand Down
Loading