This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Vector] Add custom slt / SCF.if folding to VectorToSCF
ClosedPublic

Authored by nicolasvasilache on Jul 3 2020, 1:22 PM.

Details

Summary

scf.if currently lacks folding on true / false conditionals.
Such foldings are a bit more involved than can be addressed immediately.
This revision introduces an eager folding for lowering vector.transfer operations in the presence of unrolling.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript

Fix typo in test

ThomasRaoux added inline comments.Jul 6 2020, 12:54 AM
mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
193

Should it be *maybeCstV < *maybeCstUb since we are trying to fold less than?

217

Don't we need to increment idx even if the condition was folded?

nicolasvasilache marked 2 inline comments as done.

Address review

ftynse accepted this revision.Jul 6 2020, 4:39 AM
ftynse added inline comments.
mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
215

Nit: I'd give this a different name. if (inBounds) reads like "if the transfer is in bounds", but in fact means "if there exists a dynamic condition for the transfer to be in bounds" and if (!inBounds) will actually give a static guarantee that the transfer is in bounds.

This revision is now accepted and ready to land.Jul 6 2020, 4:39 AM

Rename variable

This revision was automatically updated to reflect the committed changes.