[llvm-dev] Multi-Threading Compilers
Chris Lattner via llvm-dev
llvm-dev at lists.llvm.org
Sat Feb 29 14:19:22 PST 2020
On Feb 29, 2020, at 2:08 PM, David Blaikie <dblaikie at gmail.com> wrote:
> I've
> curious as
> to how MLIR deals with IPO as that's the problem I was running into.
>
> FWIW I believe LLVM's new pass manager (NPM) was designed with parallelism and the ability to support this situation (that MLIR doesn't? Or doesn't to the degree/way in which the NPM does). I'll leave it to folks (Chandler probably has the most context here) to provide some more detail there if they can/have time.
Historically speaking, all of the LLVM pass managers have been designed to support multithreaded compilation (check out the ancient history of the WritingAnLLVMPass <http://llvm.org/docs/WritingAnLLVMPass.html> doc if curious).
The problem is that LLVM has global use-def chains on constants, functions and globals, etc, so it is impractical to do this. Every “inst->setOperand” would have to be able to take locks or use something like software transactional memory techniques in their implementation. This would be very complicated and very slow.
MLIR defines this away from the beginning. This is a result of the core IR design, not the pass manager design itself.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200229/8011dba8/attachment.html>
More information about the llvm-dev
mailing list