[mlir][Inliner] Use llvm::parallelForEach instead of llvm::parallelTransformReduce
authorRiver Riddle <riddleriver@gmail.com>
Tue, 23 Feb 2021 22:22:30 +0000 (14:22 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 23 Feb 2021 22:36:45 +0000 (14:36 -0800)
commitabd3c6f24c823be6fb316b501482d8637c4a0724
tree3028b47aed9412cf9ae218c2b76f8a8d41c06355
parent65a3197a8fa2e5d1deb8707bda13ebd21e1dedb3
[mlir][Inliner] Use llvm::parallelForEach instead of llvm::parallelTransformReduce

llvm::parallelTransformReduce does not schedule work on the caller thread, which becomes very costly for
the inliner where a majority of SCCs are small, often ~1 element. The switch to llvm::parallelForEach solves this,
and also aligns the implementation with the PassManager (which realistically should share the same implementation).

This change dropped compile time on an internal benchmark by ~1(25%) second.

Differential Revision: https://reviews.llvm.org/D96086
mlir/lib/Transforms/Inliner.cpp