This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] NFC - Post-commit cleanups
AbandonedPublic

Authored by nicolasvasilache on Jan 2 2020, 2:32 PM.

Details

Summary

This diff addresses leftovers from https://reviews.llvm.org/D72022.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 2 2020, 2:32 PM

Unit tests: pass. 61175 tests passed, 0 failed and 729 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

rriddle requested changes to this revision.Jan 3 2020, 9:57 AM
rriddle added inline comments.
mlir/include/mlir/Support/Functional.h
50

This seems hardcoded for a very specific type of iterator element, i.e. one where the result is nullable.

This revision now requires changes to proceed.Jan 3 2020, 9:57 AM
nicolasvasilache marked an inline comment as done.Jan 3 2020, 10:10 AM
nicolasvasilache added inline comments.
mlir/include/mlir/Support/Functional.h
50

I can rename to map_if_non_null.
I was reluctant on forcing a second lambda and turn into a map_if but I could do that too and impl map_if_non_null in terms of that.
Thoughts?

Addressing review comments.

Update comments.

Unit tests: pass. 61237 tests passed, 0 failed and 729 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Unit tests: pass. 61237 tests passed, 0 failed and 729 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

rriddle added inline comments.Jan 5 2020, 8:56 PM
mlir/include/mlir/Support/Functional.h
50

I'm not convinced that these methods are worth it. This looks like a case that is already covered by a combination of map+filter ranges.

rriddle added inline comments.Jan 5 2020, 9:13 PM
mlir/include/mlir/Support/Functional.h
50

FWIW, this also applies to other things within this file; e.g. I don't really see the benefit of 'map' when you can use llvm::map_range instead. At that point, you can opt into vector materialization if you actually need it. This file seems to be reimplementing many of the iterator ranges, albeit using SmallVector instead of using iterator ranges.

nicolasvasilache marked an inline comment as done.Jan 6 2020, 7:02 PM
nicolasvasilache added inline comments.
mlir/include/mlir/Support/Functional.h
50

fair enough, a lot of this predates my realizing that LLVM had STLExtras, I'll rework to cleanup.

nicolasvasilache abandoned this revision.May 5 2020, 12:37 PM