Skip to content

[test] [llvm] Add assert to builder#8689

Closed
hughperkins wants to merge 4 commits into
taichi-dev:masterfrom
hughperkins:hp/add-assert-to-builder
Closed

[test] [llvm] Add assert to builder#8689
hughperkins wants to merge 4 commits into
taichi-dev:masterfrom
hughperkins:hp/add-assert-to-builder

Conversation

@hughperkins
Copy link
Copy Markdown
Contributor

Issue: #

Brief Summary

Add assert to IR builder. Use like:

builder.create_assert(bool_true, "assertion failed");

Example IR:

               kernel {
                 <u1> $0 = const true
                 1 : assert $0, "assertion failed"
               }

Will facilitate creating unit test for CFG issue.

Note: this depends on the PR that adds a boolean constant to ir builder.

copilot:summary

Walkthrough

copilot:walkthrough

@feisuzhu
Copy link
Copy Markdown
Contributor

/rebase

@taichi-gardener taichi-gardener force-pushed the hp/add-assert-to-builder branch from b1d9854 to dd78bd5 Compare April 28, 2025 01:51
@feisuzhu feisuzhu requested a review from bobcao3 April 28, 2025 11:14
@hughperkins
Copy link
Copy Markdown
Contributor Author

Empirically, looks like I've stopped using the Builder, e.g. https://github.com/hughperkins/taichi/blob/45cbcd5ec8601c65138c900ed271b24ac1843a19/tests/cpp/ir/control_flow_graph_test.cpp#L72-L109 I'll close this PR (If I need the Builder assert (or if someone else does) I'll re-open it).

@hughperkins hughperkins closed this May 2, 2025
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.

2 participants