Page MenuHomePhabricator

[MLIR] Change return type of ParallelOp::getInductionVars to ValueRange.
ClosedPublic

Authored by pifon2a on Apr 6 2020, 12:11 AM.

Details

Summary

The current return type sometimes leads to code like to_vector<2>(ValueRange(loop.getInductionIvs())). I think it would be nice to shorten it. Users who need access to Block::BlockArgListType (if there are any), can always call getBody()->getArguments(); if needed.

Also remove getNumInductionVars(), since there is getNumLoops().

Diff Detail

Event Timeline

pifon2a created this revision.Apr 6 2020, 12:11 AM
pifon2a edited the summary of this revision. (Show Details)Apr 6 2020, 12:13 AM
pifon2a edited reviewers, added: bkramer; removed: nicolasvasilache.
ftynse accepted this revision.Apr 6 2020, 12:37 AM
This revision is now accepted and ready to land.Apr 6 2020, 12:37 AM

Can you motivate the change "Change return type of ParallelOp::getInductionVars to ValueRange" in the description ?

pifon2a edited the summary of this revision. (Show Details)Apr 6 2020, 12:58 AM

@mehdi_amini done, thanks!

mehdi_amini accepted this revision.Apr 6 2020, 1:05 AM

Thanks!

herhut accepted this revision.Apr 6 2020, 1:27 AM

Nice! Thanks.

This revision was automatically updated to reflect the committed changes.