Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IR] Add inline docs to all statements #2276

Merged
merged 8 commits into from Apr 21, 2021
Merged

Conversation

xumingkuan
Copy link
Collaborator

@xumingkuan xumingkuan commented Apr 20, 2021

Related issue = #2193 #2192

This PR adds inline docs to all statements in statements.h.

[Click here for the format server]


@xumingkuan xumingkuan changed the title [ir] Add inline docs to statements [IR] Add inline docs to all statements Apr 20, 2021
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took another look. Please help resolve the variable quoting style, thanks!

taichi/ir/statements.h Outdated Show resolved Hide resolved
taichi/ir/statements.h Outdated Show resolved Hide resolved
taichi/ir/statements.h Outdated Show resolved Hide resolved
taichi/ir/statements.h Outdated Show resolved Hide resolved
taichi/ir/statements.h Outdated Show resolved Hide resolved
@@ -147,6 +165,9 @@ class RandStmt : public Stmt {
TI_DEFINE_ACCEPT_AND_CLONE
};

/**
* A binary operation. TODO: remove the field is_bit_vectorized.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Move TODO to its own line, 2) properly quote the variable

@@ -174,6 +195,10 @@ class BinaryOpStmt : public Stmt {
TI_DEFINE_ACCEPT_AND_CLONE
};

/**
* A ternary operation. Currently "select" (the ternary conditional operator,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls unify the variable quoting style

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is not a variable :-)

taichi/ir/statements.h Outdated Show resolved Hide resolved
@@ -225,6 +256,9 @@ class ExternalPtrStmt : public Stmt {
TI_DEFINE_ACCEPT_AND_CLONE
};

/**
* A global pointer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit more explanation on this (on a new paragraph)? For example, this will not show up in the final lowered IR.

taichi/ir/statements.h Outdated Show resolved Hide resolved
@@ -1041,11 +1191,15 @@ class ClearListStmt : public Stmt {
// Checks if the task represented by |stmt| contains a single ClearListStmt.
bool is_clear_list_task(const OffloadedStmt *stmt);

/**
* TODO: document for InternalFuncStmt
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... what's an InternalFuncStmt?

Copy link
Member

@k-ye k-ye Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be used by ti.call_internal, which is to run some C++ tests in taichi/runtime/llvm/internal_functions.h.

Let's put a TODO saying that we'd like to remove this :)

xumingkuan and others added 2 commits April 21, 2021 13:51
Co-authored-by: Ye Kuang <k-ye@users.noreply.github.com>
@xumingkuan
Copy link
Collaborator Author

@k-ye Thanks for the review!

@xumingkuan xumingkuan requested a review from k-ye April 21, 2021 06:05
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you so much!

@k-ye k-ye merged commit ee4bec2 into taichi-dev:master Apr 21, 2021
@k-ye k-ye mentioned this pull request Apr 25, 2021
@xumingkuan xumingkuan deleted the doc0 branch April 29, 2021 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants