This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add a utility iterator range that repeats a given value `n` times.
ClosedPublic

Authored by rriddle on Feb 15 2020, 11:32 PM.

Details

Summary

This range is useful when an desired API expects a range or when comparing two different ranges for equality, but the underlying data is a splat. This range removes the need to explicitly construct a vector in those cases.

Depends On D74682

Diff Detail

Event Timeline

rriddle created this revision.Feb 15 2020, 11:32 PM

Can we add this to llvm STLExtras? (since we should upstream all these utilities anyway...)

mlir/include/mlir/Support/STLExtras.h
358

You're the native speaker, but I would have expected to read make_repeated_range?

Can we add this to llvm STLExtras? (since we should upstream all these utilities anyway...)

I was going to originally, but this relies on indexed_accessor_range which also needs to be upstreamed.

mehdi_amini accepted this revision.Feb 19 2020, 10:13 PM

Can we add this to llvm STLExtras? (since we should upstream all these utilities anyway...)

I was going to originally, but this relies on indexed_accessor_range which also needs to be upstreamed.

OK, but that's a good reminder that we need to upstream all this :)

This revision is now accepted and ready to land.Feb 19 2020, 10:13 PM
rriddle updated this revision to Diff 245941.Feb 21 2020, 11:51 AM
rriddle marked an inline comment as done.

Resolve comments.

This revision was automatically updated to reflect the committed changes.