Page MenuHomePhabricator

[mlir] Canonicalize IfOp with trivial `then` and `else` bodies to list of SelectOp's
ClosedPublic

Authored by Hardcode84 on Mar 13 2021, 3:27 PM.

Details

Summary
  • Do we need a threshold on maximum number of Yeild arguments processed (maximum number of SelectOp's to be generated)?
  • Had to modify some old IfOp tests to not get optimized by this pattern

Diff Detail

Event Timeline

Hardcode84 created this revision.Mar 13 2021, 3:27 PM
Hardcode84 requested review of this revision.Mar 13 2021, 3:27 PM
mehdi_amini accepted this revision.Mar 13 2021, 7:25 PM
mehdi_amini added inline comments.
mlir/test/Dialect/SCF/canonicalize.mlir
139

Can you add a test with multiple results for the scf.if?

This revision is now accepted and ready to land.Mar 13 2021, 7:25 PM
mehdi_amini added inline comments.Mar 13 2021, 8:34 PM
mlir/lib/Dialect/SCF/SCF.cpp
944

Is this case already covered somewhere else? An empty scf.if gets removed during canonicalization?

rriddle added inline comments.Mar 13 2021, 8:39 PM
mlir/lib/Dialect/SCF/SCF.cpp
952

Remove all of the mlir::.

959

Spell out auto here.

Review comments, more tests, added some asserts

Hardcode84 added inline comments.Mar 14 2021, 1:46 AM
mlir/lib/Dialect/SCF/SCF.cpp
944

It seems this case already covered somewhere else, added tests for this

mehdi_amini accepted this revision.Mar 19 2021, 4:17 PM

Still LG, you have commit access now right?