This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add for loop specialization
ClosedPublic

Authored by herhut on Jun 19 2020, 7:25 AM.

Details

Summary

We already has a parallel loop specialization pass that is used to
enable unrolling and consecutive vectorization by rewriting loops
whose bound is defined as a min of a constant and a dynamic value
into a loop with static bound (the constant) and the minimum as
bound, wrapped into a conditional to dispatch between the two.
This adds the same rewriting for for loops.

Diff Detail

Event Timeline

herhut created this revision.Jun 19 2020, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2020, 7:25 AM
herhut updated this revision to Diff 272066.Jun 19 2020, 7:28 AM

Add missing pieces...

herhut updated this revision to Diff 272070.Jun 19 2020, 7:34 AM

formatting

Harbormaster completed remote builds in B61026: Diff 272070.
rriddle added inline comments.Jun 19 2020, 11:08 AM
mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp
73

nit: Spell out the type here.

ftynse accepted this revision.Jun 22 2020, 12:52 AM
ftynse added inline comments.
mlir/include/mlir/Dialect/SCF/Passes.td
16

Nit: can we take the first 'for' into single quotes for improved readability?

This revision is now accepted and ready to land.Jun 22 2020, 12:52 AM
herhut updated this revision to Diff 272344.Jun 22 2020, 1:14 AM
herhut marked 2 inline comments as done.

comments + rebase

Review comments...

This revision was automatically updated to reflect the committed changes.