summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/LoopTiling.cpp
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-03-08 07:45:26 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 17:06:36 -0700
commit8b4b9b31f19846d9721b5cf9ec20d1e97a38707c (patch)
tree40010f5f324523fa69383d8e850b28316ec08adf /mlir/lib/Transforms/LoopTiling.cpp
parent1e55ae19a0e4a95f86a681a9c682192712908276 (diff)
downloadbcm5719-llvm-8b4b9b31f19846d9721b5cf9ec20d1e97a38707c.tar.gz
bcm5719-llvm-8b4b9b31f19846d9721b5cf9ec20d1e97a38707c.zip
Python bindings: introduce loop and loop nest contexts
Recently, EDSC introduced an eager mode for building IR in different contexts. Introduce Python bindings support for loop and loop nest contexts of EDSC builders. The eager mode is built around the notion of ValueHandle, which is convenience class for delayed initialization and operator overloads. Expose this class and overloads directly. The model of insertion contexts maps naturally to Python context manager mechanism, therefore new bindings are defined bypassing the C APIs. The bindings now provide three new context manager classes: FunctionContext, LoopContext and LoopNestContext. The last two can be used with the `with`-construct in Python to create loop (nests) and obtain handles to the loop induction variables seamlessly: with LoopContext(lhs, rhs, 1) as i: lhs + rhs + i with LoopContext(rhs, rhs + rhs, 2) as j: x = i + j Any statement within the Python context will trigger immediate emission of the corresponding IR constructs into the context owned by the nearest context manager. PiperOrigin-RevId: 237447732
Diffstat (limited to 'mlir/lib/Transforms/LoopTiling.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud