Commit Graph

29 Commits (26fd2a576e2d919c795f0afb0abfff3b3128e2d1)

Author SHA1 Message Date
Stella Laurenzo e45287d83e Rename 'macro' nomenclature to 'partial eval'. 2020-06-26 13:50:51 -07:00
Stella Laurenzo dd6a4e638b Add macro facility and use it to enable module and namedtuple attribute resolution. 2020-06-25 23:11:32 -07:00
Stella Laurenzo e5958d820f Add constant resolution from globals and builtins. 2020-06-22 18:42:32 -07:00
Stella Laurenzo f791909a25 Factor name resolution and constant creation to a new environment facility. 2020-06-22 18:15:56 -07:00
Stella Laurenzo b3ecd57b29 Add a sample test that exercises short circuit control flow. 2020-06-19 17:25:18 -07:00
Stella Laurenzo b811db4b76 Wrap the IREE compiler flow in a one stop API. 2020-06-19 17:17:22 -07:00
Stella Laurenzo 529873d13c Wire up IREE compilation and runtime in a new backend test.
* Adds python bindings for invoking flow, HAL, and VM lowering pipelines.
* Adds pythong bindings for translating to VM module flatbuffer.
* Adds a new backend_test/iree directory and configure lit to find the IREE python rt bindings.
* Open code a simple_invoke.py that exercises the whole pipeline (need real APIs for a lot of this).
* Fails when invoking the function because I never implemented argument marshaling for scalars :(
* Plenty of stuff to do tomorrow.
2020-06-19 00:30:34 -07:00
Stella Laurenzo b21b5322f6 Basicpy conversion to IREE+std skeleton and first conversions.
* Conversions to std for numeric binary expressions, numeric to_boolean, and numeric comparisons.
* Added folders to constant ops to comply with requirements of the pass system.
* Extended the frontend with parameter/result annotation processing for primitives (can specify types for function arguments).
* Added (empty) directory/sources for IREEVM conversions. These are only enabled if IREE is enabled.
2020-06-13 23:45:43 -07:00
Stella Laurenzo 2ba8296151 Add script tools/format_source.sh and run it on all python and c++ sources. 2020-06-13 14:53:54 -07:00
Stella Laurenzo c3d4436397 Introduce a Target class and use it to define generic 32 and 64bit variants. 2020-06-13 14:43:10 -07:00
Stella Laurenzo 917fd94f94 Add limited support for function arguments. 2020-06-10 19:17:29 -07:00
Stella Laurenzo 6728503fcf Remove unused assignment 2020-06-09 18:35:21 -07:00
Stella Laurenzo 340f109742 Add implicit return and expression statements where the value id discarded. 2020-06-09 18:34:07 -07:00
Stella Laurenzo 2bb4cdf4e7 Split frontent.py into importer.py. 2020-06-09 17:16:36 -07:00
Stella Laurenzo 22cbe044c2 Add IfExp emission. 2020-06-09 17:10:52 -07:00
Stella Laurenzo e18e8e0a96 Add boolean/logical operations (and, or, not).
* Adds a new to_boolean op to evaluate a value as a truthy i1
* Uses cascading scf.if ops to properly evaluate and/or sequences (short-circuit and original value returning)
* Adds a helper to construct select ops and uses it to implement 'not'
2020-06-09 00:01:21 -07:00
Stella Laurenzo 44f7e22f4d Remove 2-arg compare special case and use common utility to do sub evaluation. 2020-06-08 17:54:14 -07:00
Stella Laurenzo 1ef3614682 Add support for short-circuit comparisons with scf.if. 2020-06-08 17:52:07 -07:00
Stella Laurenzo a32219c3bb Refactor things so that an SCF mixin dialect helper can be used.
* Makes the OpBuilder an input to the DialectHelper.
* The containment hierarchy can be simplified further.
* There are still only a few places this is instantiated, so opting for working over great.
2020-06-08 16:10:51 -07:00
Stella Laurenzo 85b724e70c Adds ODS and import support for binary_expr and binary_compare ops.
* Currently only supports non-short-circuit comparisons.
2020-06-08 13:46:06 -07:00
Stella Laurenzo 7c176ed872 Add None constants. 2020-06-07 16:21:00 -07:00
Stella Laurenzo 4cd604f2a2 Fix AST constant handling to be compatible with 3.8 (the right way). 2020-06-07 16:16:19 -07:00
Stella Laurenzo 72499e0319 Add bytes constants. 2020-06-07 16:00:29 -07:00
Stella Laurenzo a1e6ff4ab7 Add ellipsis constants. 2020-06-07 15:49:39 -07:00
Stella Laurenzo f3829b1d4f Add string constants. 2020-06-07 15:46:28 -07:00
Stella Laurenzo 869228e316 Add bool constants. 2020-06-07 15:15:19 -07:00
Stella Laurenzo af4466197e Add lit test suite for python compiler.
* Adds a test for simple constants and fixes issues.
2020-06-07 14:29:39 -07:00
Stella Laurenzo 28048337ae Fix issue with float_attr. 2020-06-06 22:01:38 -07:00
Stella Laurenzo 0cc0a7165e Add basic AST -> basicpy dialect function extraction.
* Extends the bindings to support locations.
* Various other things necessary to extract a function with simple numeric expressions.
2020-06-06 21:24:28 -07:00