This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][TOSA] Resubmit Tosa to Standard/SCF Lowerings (const, if, while)"
ClosedPublic

Authored by rsuderman on Feb 25 2021, 10:58 PM.

Details

Summary

Includes a lowering for tosa.const, tosa.if, and tosa.while to Standard/SCF dialects. TosaToStandard is
used for constant lowerings and TosaToSCF handles the if/while ops.

Resubmission of https://reviews.llvm.org/D97518 with ASAN fixes.

Diff Detail

Event Timeline

rsuderman created this revision.Feb 25 2021, 10:58 PM
rsuderman requested review of this revision.Feb 25 2021, 10:58 PM
stellaraccident accepted this revision.Feb 26 2021, 12:39 AM

Lgtm, but let's get Mehdi's eyes because he spotted the bug I was missing.

This revision is now accepted and ready to land.Feb 26 2021, 12:39 AM

Clang-tidy fixes.

mehdi_amini added inline comments.Feb 26 2021, 3:17 PM
mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp
54

Aren't the region "single block" regions? If so can we "not loop" here?

56

This should be the terminator of the block, can we just get it directly instead of walking the block?

I'm also concerned about nested cases here: you'll catch YieldOp that are potentially nested in the IR while you should only touch the region you're converting here.

71

This delayed deleting shouldn't be needed, you should be able to erase when replacing.

rsuderman updated this revision to Diff 326846.Feb 26 2021, 4:50 PM

Updated to expect only a single block and handle a single terminator. Also referred delayed deletion.

rsuderman marked 3 inline comments as done.Feb 26 2021, 4:50 PM
mehdi_amini accepted this revision.Feb 26 2021, 5:09 PM

Nice, I think the code looks much simpler :)

This revision was landed with ongoing or failed builds.Feb 26 2021, 5:50 PM
This revision was automatically updated to reflect the committed changes.