- Removes index based insertion. All insertion now happens through the insertion point.
- Introduces thread local context managers for implicit creation relative to an insertion point.
- Introduces (but does not yet use) binding the Context to the thread local context stack. Intent is to refactor all methods to take context optionally and have them use the default if available.
- Adds C APIs for mlirOperationGetParentOperation(), mlirOperationGetBlock() and mlirBlockGetTerminator().
- Removes an assert in PyOperation creation that was incorrectly constraining. There is already a TODO to rework the keepAlive field that it was guarding and without the assert, it is no worse than the current state.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Very nice!
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
647 | Nit: remove trivial brace. | |
685 | This API does not have a user in this patch right now. | |
905 | (trivial braces twice here) | |
967 | (trivial brace) | |
996 | (trivial brace) | |
1023 | (trivial brace, and above) | |
mlir/lib/Bindings/Python/IRModules.h | ||
100 | Why the difference between the two APIs? (one is returning nullptr the other throwing an exception)? | |
110 | Why a std::list instead of a vector? |
Thanks. PTAL.
mlir/lib/Bindings/Python/IRModules.cpp | ||
---|---|---|
685 | I'm going to leave it (it is leaking from the next patch and has an implementation in line with the one for default insertion points). | |
mlir/lib/Bindings/Python/IRModules.h | ||
100 | Just added them as needed (here and leaking from the followup). I've normalized them with a required flag. I would like the accessors for the default context and insertion point centralized because the next patch wires them in various ways for converting args when not explicitly provided, and the exception raising should be in one place. | |
110 | I suppose because "that's what I always do for these context manager holders" isn't a great answer, considering that we all know that list is inferior if not used for specific things :) I've switch to vector, and in my defense, I think I was reaching for it because of previous designs that needed to store non-movable types. |
Why the difference between the two APIs? (one is returning nullptr the other throwing an exception)?