diff --git a/taichi/codegen/spirv/lib_tiny_ir.h b/taichi/codegen/spirv/lib_tiny_ir.h index e5d9663ff36ab..ca4df0c922009 100644 --- a/taichi/codegen/spirv/lib_tiny_ir.h +++ b/taichi/codegen/spirv/lib_tiny_ir.h @@ -60,7 +60,7 @@ class Polymorphic { return typeid(*this) == typeid(other) && is_equal(other); } - const bool equals(const Polymorphic *other) const { + bool equals(const Polymorphic *other) const { return (*this) == (*other); } diff --git a/taichi/ir/statements.h b/taichi/ir/statements.h index a86d91f715c1e..dad5e57aae77a 100644 --- a/taichi/ir/statements.h +++ b/taichi/ir/statements.h @@ -734,7 +734,7 @@ class ConstStmt : public Stmt { explicit ConstStmt(const LaneAttribute &val) : val(val) { TI_ASSERT(val.size() == 1); // TODO: support vectorized case ret_type = val[0].dt; - for (int i = 0; i < val.size(); i++) { + for (std::size_t i = 0; i < val.size(); i++) { TI_ASSERT(val[0].dt == val[i].dt); } TI_STMT_REG_FIELDS;