Commit Graph

67 Commits

Author SHA1 Message Date
David Nadlinger cc00ae9580 compiler: Implement broadcasting of math functions 2020-08-09 03:54:42 +01:00
David Nadlinger d37503f21d compiler: T{C -> External}Function, clarify docs [nfc] 2020-08-09 03:54:41 +01:00
David Nadlinger a7e855b319 compiler.types: Change invalid default value [nfc]
This wasn't actually ever used, but was a dict instead of a set.
2020-08-09 03:54:41 +01:00
David Nadlinger dea3c0c572 compiler: Don't store redundant ndarray buffer length, match list layout
This adds `elt` to _TPointer and the ir.Offset IR instruction,
which is like GetElem but without the final load.
2020-08-09 03:54:41 +01:00
David Nadlinger d8c81d6d05 compiler: Other types microoptimisations
Interestingly enough, these actually seem to give a measurable
speedup (if small – about 1% improvement out of 6s whole-program
compile-time in one particular test case).

The previous implementation of is_mono() had also interesting
behaviour if `name` wasn't given; it would test only for the
presence of any keys specified via keyword arguments,
disregarding their values. Looking at uses across the current
ARTIQ codebase, I could neither find a case where this would
have actually been triggered, nor any rationale for it.

With the short-circuited implementation from this commit,
is_mono() now checks name/all of params against any specified
conditions.
2020-01-01 08:49:19 +00:00
David Nadlinger 2c34f0214b compiler: Short-circuit Type.unify() with identical other type
This considerably improves performance; ~15% in terms of total
artiq_run-to-kernel-compiled duration in one test case.
2020-01-01 08:49:19 +00:00
whitequark 49682d0159 Improve Python 3.7 compatibility.
async is now a full (non-contextual) keyword.

There are two more instances:
   - artiq/frontend/artiq_client.py
   - artiq/devices/thorlabs_tcube/driver.py

It is not immediately clear how to fix those, so they are left for
later work.
2019-01-12 13:17:59 +00:00
whitequark 38dac16041 compiler: don't crash when quoting builtin functions.
Fixes #1051.
2018-06-05 23:27:23 +00:00
whitequark 86dea869b3 compiler.types: add missing TTuple.__hash__ implementation. 2017-03-03 03:27:49 +00:00
whitequark cd68577dbc compiler: add support for async RPCs. 2016-10-30 00:57:31 +00:00
whitequark 933ea53c77 compiler: add basic numpy array support (#424). 2016-07-06 09:51:57 +00:00
whitequark fa71b40c80 compiler: print the builtin type int(width=...) as np.int... 2016-07-06 04:22:51 +00:00
whitequark f2ae24da39 compiler: add support for Python modules.
Fixes #408.
2016-06-21 23:35:07 +00:00
whitequark 1464bae6b7 compiler: don't typecheck RPCs except for return type.
Fixes #260.
2016-04-26 01:12:36 +00:00
whitequark 1038f1321f compiler: allow specifying per-function "fast-math" flags.
Fixes #351.
2016-03-28 21:44:08 +00:00
whitequark 6f5332f892 compiler: allow flagging syscalls, providing information to optimizer.
This also fixes a crash in test_cache introduced in 1d8b0d46.
2016-03-28 19:56:56 +00:00
whitequark f4e6b18690 compiler: implement kernel constant attributes.
Part of #322.
2016-03-27 16:10:07 +00:00
whitequark 8bbffab8c8 Fix tests. 2016-02-27 13:40:37 +00:00
whitequark e421b22953 types.TypePrinter: don't waste screen space on empty attribute lists. 2016-02-27 13:29:47 +00:00
whitequark d899d7307e compiler.types: TDelay is always unifiable with self. 2016-02-25 19:56:12 +00:00
whitequark 919a49b6bc compiler: quell excessively detailed diagnostics. 2016-02-25 19:43:52 +00:00
whitequark 211af77e77 validators.escape: cache_get result lives forever. 2016-01-10 14:43:21 +00:00
whitequark 5baf18ba0d transforms.inferencer: factor out _unify_attribute. 2016-01-04 22:13:05 +08:00
whitequark 2e33084a5f transforms.llvm_ir_generator: implement instrumentation for attribute writeback. 2016-01-02 06:51:30 +08:00
whitequark 25e2824709 validators.escape: infer correct region for arguments. 2015-12-30 16:19:35 +08:00
whitequark 82ec76af3e compiler.types: fix TFunction internal field order (closes #208). 2015-12-26 18:08:51 +08:00
whitequark f4b19fee5c compiler.types: make TValue hashable. 2015-12-18 17:31:20 +08:00
whitequark 25027f6907 compiler: fix tests. 2015-12-10 23:16:36 +08:00
whitequark 8cb2215edb transforms.inferencer: only instantiate RPC function types, not regular. 2015-12-02 21:48:14 +08:00
whitequark 237e983770 compiler.types: replace isinstance() with .__class__==.
This provides a 50% speedup.
2015-11-27 18:22:55 +08:00
whitequark 6122fd70ca compiler.types: TVar.find: improve path compression.
After this change, the compiler's complexity is nearly linear
even when very large arrays are used.
2015-11-27 18:08:46 +08:00
whitequark bf1a583fda compiler.types: fix TVar.find() for very large paths. 2015-11-27 18:02:27 +08:00
whitequark 00164390a1 compiler.types: fix TDelay.unify(TVar()). 2015-11-27 17:10:36 +08:00
whitequark 16ae0fb6eb compiler.embedding: instantiate RPC method types (fixes #180). 2015-11-27 16:29:13 +08:00
whitequark 3b529c6f90 compiler.types: implement map. 2015-11-26 11:16:39 +08:00
whitequark e1cd2ccd40 compiler: pull in dependencies in more finely grained way (fixes #181). 2015-11-24 17:32:04 +08:00
whitequark a2d73c8b05 compiler.types: dump type variable iodelay explicitly. 2015-11-17 00:51:56 +03:00
whitequark a0c6f75f9b compiler.types: fix obsolete iodelay references. 2015-11-07 15:14:19 +03:00
whitequark 7a6fc3983c Make delay component of function type unifyable. 2015-09-30 18:41:14 +03:00
whitequark b971cc8cdf compiler.{iodelay,transforms.iodelay_estimator}: implement. 2015-09-02 17:55:48 -06:00
whitequark 6a29775bf0 compiler.types.Type: more useful __str__. 2015-08-28 02:53:12 -05:00
whitequark ac92aabce1 Fix default argument fiasco. 2015-08-28 02:50:40 -05:00
whitequark 13e612c11b Fix tests. 2015-08-28 00:51:31 -05:00
whitequark d0fd61866f compiler.types: print fields of instance types. 2015-08-27 17:25:01 -05:00
whitequark a3284f8978 compiler.types: fix module paths in __repr__. 2015-08-27 15:46:36 -05:00
whitequark cb225269ff Allow accessing attributes of embedded host objects. 2015-08-27 05:01:04 -05:00
whitequark afc3f36104 ARTIQIRGenerator: fix polymorphic print on closures. 2015-08-19 12:37:22 -07:00
whitequark 51c591f01a Unbreak tests. 2015-08-18 22:44:09 -07:00
whitequark 6c8de9b6d4 Implement methods. 2015-08-18 22:39:22 -07:00
whitequark 94a2d5f5fa Implement class attribute access through instances. 2015-08-15 11:07:54 -04:00