This is an archive of the discontinued LLVM Phabricator instance.

[mlir] SCF: provide function_ref builders for IfOp
ClosedPublic

Authored by ftynse on May 25 2020, 9:56 AM.

Details

Summary

Now that OpBuilder is available in build functions, it becomes possible to
populate the "then" and "else" regions directly when building the "if"
operation. This is desirable in more structured forms of builders, especially
in when conditionals are mixed with loops. Provide new build APIs taking
callbacks for body constructors, similarly to scf::ForOp, and replace more
clunky edsc::BlockBuilder uses with these. The original APIs remain available
and go through the new implementation.

Diff Detail

Event Timeline

ftynse created this revision.May 25 2020, 9:56 AM
Herald added a project: Restricted Project. · View Herald Transcript
nicolasvasilache accepted this revision.May 26 2020, 2:53 AM

Nice, thanks!

This revision is now accepted and ready to land.May 26 2020, 2:53 AM
This revision was automatically updated to reflect the committed changes.