Commit Graph

70 Commits

Author SHA1 Message Date
Dmitry Stogov
c0fbdd2204 Allow resolution of DATA->DATA references represented as SYM+OFFSET 2023-12-20 18:37:27 +03:00
Dmitry Stogov
3f9d8112f0 Allow delayed resolution of DATA->DATA and DATA->CODE symbolic references 2023-12-20 15:50:09 +03:00
Dmitry Stogov
f385b006ea Store constant data in the code_buffer segment 2023-12-20 12:56:26 +03:00
Dmitry Stogov
efe122c320 Fixed incorrect padding when convert LLVM to IR without --run 2023-12-20 12:27:13 +03:00
Dmitry Stogov
3dd4146097
Allow using "thunks" to call "far" functions (#57)
* Allow using "thunks" to call "far" functions

* Fix Windows tests

* Fix identation
2023-12-19 22:22:49 +03:00
Dmitry Stogov
5b2619243a Fixed several LLVM loader bugs 2023-12-14 01:30:48 +03:00
Dmitry Stogov
27f5e34d90 Support for constants with references to other data structures 2023-12-13 21:03:39 +03:00
Dmitry Stogov
05db256d87 Dot't print exit code after "--run" (delegate this to tester) 2023-12-13 15:59:54 +03:00
Dmitry Stogov
755be821ca Pass the arguments following the "--run" option to JIT-ed main(). 2023-12-13 12:07:04 +03:00
Dmitry Stogov
f7377e806d Fix Windows build 2023-12-08 02:03:02 +03:00
Dmitry Stogov
b7e7de5821 Simplify JIT code buffer management 2023-12-08 01:58:45 +03:00
Dmitry Stogov
6898d26e80 Allow code generation for functions with unesolved symbols 2023-12-06 16:30:44 +03:00
Dmitry Stogov
2c67a3ac86 Fixed support for forward declarations 2023-12-06 14:36:11 +03:00
Dmitry Stogov
0981d76cc7 iImproved LLVM export (builtin function support) 2023-12-06 12:47:03 +03:00
Dmitry Stogov
6a7a87529c Improve LLVM export (avoid duplicate function declarations) 2023-12-05 23:09:39 +03:00
Dmitry Stogov
76e6418cae Support for function prototypes 2023-11-30 21:10:41 +03:00
Dmitry Stogov
1671b3de78 Use common JIT code buffer on AArch64. It's also used for veneers. 2023-11-23 00:18:59 +03:00
Dmitry Stogov
688f876928 mplemented code-generation for bit counting instructions 2023-11-16 22:48:05 +03:00
Dmitry Stogov
92ef948caf Implemented code-generation for CTPOP 2023-11-16 19:28:12 +03:00
Dmitry Stogov
d5596d815e Stop reporting zero exit code when run JIT-ed code 2023-11-16 13:57:37 +03:00
Dmitry Stogov
507175b228 Add VA_ARG nodes (JIT code generation is not supported yet) 2023-11-16 00:29:24 +03:00
Dmitry Stogov
a2c6f98e75 Improve LLVM loader support (incomplete) 2023-11-10 18:09:48 +03:00
Dmitry Stogov
400fa2805d An attempt to fix tests on Windows 2023-10-24 11:12:37 +03:00
Dmitry Stogov
49316643e7 Initial support for modules (incomplete) 2023-10-20 17:44:45 +03:00
Dmitry Stogov
9b1ce974cb Improve loader interface (incomplete) 2023-10-20 01:09:46 +03:00
Dmitry Stogov
d0686408e2 Initial support for SYM constants (incomplete) 2023-10-18 11:45:57 +03:00
Dmitry Stogov
4fce67fcb7 Restore accedently removed ir_free() 2023-10-11 23:01:15 +03:00
Dmitry Stogov
211884cf29 Introduce API to load modules 2023-10-11 22:55:25 +03:00
Dmitry Stogov
8668550427
Initial support for LLVM loader (incomplete) (#53)
Currently we may just load LLVM module and convert all functions into IR (print it).
For better LLVM support IR framework needs support for modules.
Some LLVM features are not supported yet (see TODOs in ir_load_llvm.c) .
2023-10-11 12:46:31 +03:00
Javier Eguiluz
2f4f8504d4
Fix some typos (#51) 2023-10-03 08:34:02 +03:00
Dmitry Stogov
51a37f159b Initial implementation of LLVM export 2023-09-28 20:44:45 +03:00
Dmitry Stogov
8977307f4e Improve error handling 2023-09-14 20:15:30 +03:00
Dmitry Stogov
0dbb794399
CI tests for MACOS build (#46) 2023-08-30 15:24:12 +03:00
Dmitry Stogov
d67c212916 Separate codegen info output into ir_dump_codegen() 2023-06-21 22:36:36 +03:00
Dmitry Stogov
4124ef5150 Allow printing IR annotated with register-allocation, spill-code-placement, de-SSA and code-generation information 2023-06-21 13:28:15 +03:00
Tony Su
42882d18f1 [ir_main]: print default optimization level in help message
At first, I had thought optimization is disabled without -O option, in
fact, the default level is 2 and let's make it clear in --help message.

Signed-off-by: Tony Su <tao.su@intel.com>
2023-05-10 19:41:18 +08:00
Tony Su
007856ffd6 [Bug]: Fix target CPU AVX availability check logic
Use && instead of & to make the checking logic clear.
Keep flag in error message compatible with --help message.

Signed-off-by: Tony Su <tao.su@intel.com>
2023-05-10 19:41:18 +08:00
Dmitry Stogov
367d2e3246 Avoid CFG reachability check after SCCP
SCCP eliminates unreachable BBs before the CFG constraction.
So ir_build_cfg() doesn't need to perforem reachability chececk if it
runs after SCCP, otherwise it starts call ir_remove_unreachable_blocks() if necessary.
User code dont have to call ir_remove_unreachable_blocks() anymore.
2023-04-27 14:18:39 +03:00
Dmitry Stogov
56b0dbccde Use ir_ctx.mflags for CPU specific code-generation options
'mflags' and ir_cpuinfo() return value have the same meaning.
2023-04-18 09:54:35 +03:00
Anatol Belski
d0b4f108ee ir_init: Accept flags as an additional arguments
Signed-off-by: Anatol Belski <ab@php.net>
2023-03-28 00:00:45 +02:00
Dmitry Stogov
f5e84ec44c Simplify compilation pipeline 2023-03-22 23:58:08 +03:00
Dmitry Stogov
e88b6ab92d Hide Windows fault message box on Windows during make test 2023-03-07 10:54:46 +03:00
Dmitry Stogov
300665700f Adopt IR test engine for Windows (this requires php and diff installed) 2023-03-01 20:31:14 +03:00
Anatol Belski
964f5a0191 build: MSVC compatibility
Signed-off-by: Anatol Belski <ab@php.net>
2023-02-25 00:04:57 +01:00
Dmitry Stogov
8b4678a9ae Add "--dump-size" option 2023-02-21 22:22:41 +03:00
Dmitry Stogov
58ba18bb7d Fix ir_test and set proper initial SP offset info for GDB backtraces 2023-01-31 11:51:55 +03:00
Dmitry Stogov
6a4e239773 Create a sparate pass to remove unreachableble CFG blocks.
SCCP pass removes unreachable blocks before CFG construction.
In case of -O0 or -O1 pipeline (without SCCP) it's simpler and faster
to unlink unreachable CFG blocks once, then check for reachability
in almost any compilation pass.
-O2 pipeline (with SCCP) don't need this pass.
2022-11-29 20:02:07 +03:00
Dmitry Stogov
cc56f12f13 Add LICENSE and copyright notices 2022-11-08 11:32:46 +03:00
Dmitry Stogov
d2a0347b21 Merge basic blocks by removing connected END to BEGIN nodes 2022-10-05 16:29:49 +03:00
Dmitry Stogov
70f6faa612 Add basic IR verification 2022-08-24 13:57:55 +03:00