This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][SCF] Create selects from if yield results which are not defined in the body
ClosedPublic

Authored by wsmoses on Mar 17 2022, 12:32 PM.

Details

Summary

Previously, the canonicalizer to create ifs from selects would only work
if the if did not have a body other than yielding. This patch upgrade the functionality
to be able to create selects from any if result whose operands are not defined
within the body.

Diff Detail

Event Timeline

wsmoses created this revision.Mar 17 2022, 12:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 12:32 PM
wsmoses requested review of this revision.Mar 17 2022, 12:32 PM
ftynse accepted this revision.Mar 18 2022, 2:56 AM
ftynse added inline comments.
mlir/lib/Dialect/SCF/SCF.cpp
1378

Nit: use braces symmetrically, i.e., if the "then" part has braces so should the "else" part even if it's trivial.

This revision is now accepted and ready to land.Mar 18 2022, 2:56 AM