Commit Graph

656 Commits

Author SHA1 Message Date
David Nadlinger 611bcc4db4 compiler: Cache expensive target data layout queries
On one typical experiment, this shaves about 3 seconds (~25%)
off the overall kernel compilation time.

GitHub: Closes #1370.
2019-10-28 11:09:25 +00:00
David Nadlinger 5d7f22ffa4 compiler: Remove provision for unused four-parameter llptr_to_var() form [nfc]
`var_type` was presumably intended to convert to a target type,
but wasn't actually acted on in the function body (nor was it
used anywhere in the codebase).
2019-10-28 11:02:46 +00:00
Sebastien Bourdeauducq c03c35f375 Revert "compiler: armv7-unknown-linux-gnueabihf -> armv7-linux-gnueabihf"
rustc insists on -unknown.

This reverts commit cf47fa44d8.
2019-08-26 11:23:00 +08:00
Sebastien Bourdeauducq cf47fa44d8 compiler: armv7-unknown-linux-gnueabihf -> armv7-linux-gnueabihf 2019-08-26 11:12:49 +08:00
Sebastien Bourdeauducq 98cd9a539c compiler: support Cortex A9 target 2019-08-26 10:46:22 +08:00
David Nadlinger cdaf554736 compiler: Implement abs() for scalars
GitHub: Fixes #1303.
2019-04-13 13:39:16 +08:00
David Nadlinger 88fd5c8440 compiler: Fix crash in escape analysis for assigning string literals 2019-03-31 17:10:27 +01:00
David Nadlinger 990e0b7dd9 compiler: Fix comparison of tuples of lists 2019-03-31 17:10:27 +01:00
David Nadlinger baf102dbb2 compiler: Fix comparison of nested lists 2019-03-31 17:10:27 +01:00
David Nadlinger f9af058b96 compiler: Quote tuples as TTuple values
Previously, they would end up being TInstances,
rendering them useless.
2019-03-31 23:40:21 +08:00
whitequark d6eb2b023a compiler: monomorphize casts first, but more carefully.
This reverts 425cd7851, which broke the use of casts to define
integer width.

Instead of it, two steps are taken:
  * First, literals are monomorphized, leading to predictable result.
  * Second, casts are monomorphized, in a top-bottom way. I.e.
    consider the expression `int64(round(x))`. If round() was visited
    first, the intermediate precision would be 32-bit, which is
    clearly undesirable. Therefore, contextual rules should take
    priority over non-contextual ones.

Fixes #1252.
2019-02-07 06:24:32 +00:00
whitequark 425cd7851e compiler: first monomorphize ints, then casts.
Fixes #1242.
2019-01-12 13:40:12 +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
Sebastien Bourdeauducq 421834fa3e compiler: document Target.little_endian 2018-12-02 19:07:18 +08:00
Sebastien Bourdeauducq 981a77834a compiler: use default triple to determine data_layout for JIT 2018-12-02 18:52:13 +08:00
Sebastien Bourdeauducq d931967e5c fix previous commits 2018-12-02 18:32:03 +08:00
Sebastien Bourdeauducq dd03fdfd1a typo 2018-12-02 18:26:54 +08:00
Sebastien Bourdeauducq 8940009e1a compiler: pass data_layout string to llvm.create_target_data before determining endianness 2018-12-02 18:26:19 +08:00
Sebastien Bourdeauducq 2e66788c6c compiler: support little endian target when storing now 2018-12-02 17:40:34 +08:00
Sebastien Bourdeauducq 7e14f3ca4e compiler,gateware: atomic now stores 2018-12-02 05:06:46 +08:00
Sebastien Bourdeauducq 8caea0e6d3 gateware,runtime: optimize RTIO kernel interface further
* now pinning (TODO: atomicity)
* for inputs, merge request and timeout registers
2018-11-08 18:29:24 +08:00
David Nadlinger 2463e5667d compiler: Fix attribute writeback with skipped fields
offset wasn't advanced for skipped fields previously,
leading to memory corruption/unaligned accesses at runtime.
2018-08-14 13:34:32 +01:00
whitequark fab6e5cdff compiler: skip functional values in attribute writeback.
Fixes #1088.
2018-08-10 12:02:49 +00:00
whitequark 93af5d2a03 compiler: handle async RPC as last statement in try block.
Fixes #1107.
2018-08-07 07:06:53 +00:00
whitequark a74958f01f ksupport: raise RuntimeError on reraise with no inflight exception.
Fixes #1123.
2018-08-07 05:53:13 +00:00
David Nadlinger 768b970deb Fixup 4359a437 (tuples of lists), add regression tests 2018-07-10 01:18:51 +01:00
David Nadlinger 4359a43732 compiler: Indirection status of TTuple depends on elements
For instance, TTuple(TList(TInt32())) has indirections, while
TTuple(TInt32()) does not.

This fixes memory corruption with RPCs that return tuples of lists.

Signed-off-by: David Nadlinger <code@klickverbot.at>
2018-07-09 18:49:50 +08:00
Sebastien Bourdeauducq 9153c4d8a3 use tokenize.open() to open Python source files
Fixes encoding issues especially with device databases modified in obscure editors.
2018-07-07 17:04:56 +08:00
whitequark 9260cdb2e8 compiler: support conversion of list to bytearray and bytes.
Fixes #1077.
2018-06-21 00:40:45 +00:00
whitequark 38dac16041 compiler: don't crash when quoting builtin functions.
Fixes #1051.
2018-06-05 23:27:23 +00:00
whitequark db4d1878d3 compiler: remove debug print. 2018-05-25 09:37:18 +00:00
whitequark fbf2c9a2fb compiler: hoist loads of kernel invariants to function entry block.
Addresses intraprocedural cases of #1007.
2018-05-25 02:18:13 +00:00
whitequark 12d1b9819c compiler: handle direct calls to class methods.
Fixes #1005.
2018-05-25 02:02:18 +00:00
whitequark ce3c8fcd3e compiler: add source location to SSA arguments.
Fixes #1006.
2018-05-22 18:14:14 +00:00
whitequark 9b4ad8b5af compiler: implement local variable demotion. 2018-05-19 17:05:34 +00:00
whitequark fd110e9848 compiler: sort predecessors in IR dump output.
Makes diffs more useful.
2018-05-19 17:02:08 +00:00
whitequark dc1c4ebf1d compiler: use ARTIQ_IR_NO_LOC variable to control IR dump output.
Useful e.g. in tests or for running diff on irgen output.
2018-05-19 17:02:08 +00:00
whitequark 21a0f26cd1 compiler: do not emit nonstandard !unconditionally* LLVM metadata.
This metadata was added by an LLVM patch that was removed because
it was unsound.
2018-05-19 16:58:03 +00:00
whitequark 3b61b7c30b compiler: fix tests after 4d06c1d8. 2018-05-16 21:53:53 +00:00
whitequark 917a4185eb Unbreak 9dc7efef. 2018-05-05 03:00:30 +00:00
whitequark 9dc7efefe4 compiler: transparently handle Windows newlines in RunTool. 2018-05-05 01:43:00 +00:00
whitequark f7e08ec46b Unbreak f35f1001. 2018-04-28 01:03:08 +00:00
whitequark f35f100110 compiler: don't crash printing locations of specialized functions.
Fixes #987.
2018-04-28 00:49:25 +00:00
whitequark 58967f14fd compiler: do not try to re-coerce fully coerced numerics. 2018-04-21 18:25:52 +00:00
whitequark b4e3c30d8c compiler: desugar x != y into not x == y (fixes #974). 2018-04-20 12:20:45 +00:00
whitequark 4b5a78e231 compiler: do not pass files to external tools while they are opened.
This fixes access violations on Windows that are present both with
input and output files. For some reason, Cygwin-compiled binutils
did not exhibit this problem, but MSYS-compiled binutils do.

Fixes #961.
2018-03-15 22:21:29 +00:00
whitequark 86ceee570f compiler: reject calls with unexpected keyword arguments.
Fixes #924.
2018-02-21 11:37:12 +00:00
whitequark 34a5445802 compiler: don't die if addr2line cannot extract line from backtrace.
Fixes #885.
2018-01-08 21:53:04 +00:00
whitequark 4d915ad15b compiler: do not permit str(...). (#878) 2017-12-27 03:10:50 +00:00
whitequark 355acb5e13 compiler: fix typo in a0a2650f. 2017-12-26 21:55:22 +00:00