[LLVMdev] Docs question: legality of inspecting other functions in a function pass

David Chisnall David.Chisnall at cl.cam.ac.uk
Thu Jul 4 01:45:27 PDT 2013


On 3 Jul 2013, at 23:05, Stephen Lin <swlin at post.harvard.edu> wrote:

> Does anyone know if there's a defined policy about this, either way?
> If so, I think it ought to be noted in the docs, for consistency.

The prohibition exists, at least in part, because in theory it would be nice to be able to run passes in parallel.  It's not a real limitation at the moment because updating instructions in a module is not thread safe (and making it so with the current APIs would probably be somewhat problematic in terms of performance) and so when we do eventually get the ability to run FunctionPasses in parallel they will most likely need new APIs.  That said, it's a good idea structurally to view the Function / Block as synchronisation boundaries so that it will be easier to support concurrent execution in the future.

David





More information about the llvm-dev mailing list