wasm-micro-runtime/tests/benchmarks/jetstream/tsf.patch
Wenyong Huang 76be848ec3
Implement the segue optimization for LLVM AOT/JIT (#2230)
Segue is an optimization technology which uses x86 segment register to store
the WebAssembly linear memory base address, so as to remove most of the cost
of SFI (Software-based Fault Isolation) base addition and free up a general
purpose register, by this way it may:
- Improve the performance of JIT/AOT
- Reduce the footprint of JIT/AOT, the JIT/AOT code generated is smaller
- Reduce the compilation time of JIT/AOT

This PR uses the x86-64 GS segment register to apply the optimization, currently
it supports linux and linux-sgx platforms on x86-64 target. By default it is disabled,
developer can use the option below to enable it for wamrc and iwasm(with LLVM
JIT enabled):
```bash
wamrc --enable-segue=[<flags>] -o output_file wasm_file
iwasm --enable-segue=[<flags>] wasm_file [args...]
```
`flags` can be:
    i32.load, i64.load, f32.load, f64.load, v128.load,
    i32.store, i64.store, f32.store, f64.store, v128.store
Use comma to separate them, e.g. `--enable-segue=i32.load,i64.store`,
and `--enable-segue` means all flags are added.

Acknowledgement:
Many thanks to Intel Labs, UC San Diego and UT Austin teams for introducing this
technology and the great support and guidance!

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
Co-authored-by: Vahldiek-oberwagner, Anjo Lucas <anjo.lucas.vahldiek-oberwagner@intel.com>
2023-05-26 10:13:33 +08:00

25 lines
849 B
Diff

diff -urN tsf-src-org/tsf_internal.h tsf-src/tsf_internal.h
--- tsf-src-org/tsf_internal.h 2023-03-31 10:49:45.000000000 +0800
+++ tsf-src/tsf_internal.h 2023-05-11 08:18:35.000000000 +0800
@@ -429,6 +429,7 @@
#endif
tsf_fsdb_connection_t *connection;
#endif
+ uint32_t __padding;
} remote;
} u;
tsf_limits_t *limits;
diff -urN tsf-src-org/tsf_ir_speed.c tsf-src/tsf_ir_speed.c
--- tsf-src-org/tsf_ir_speed.c 2023-03-31 10:49:45.000000000 +0800
+++ tsf-src/tsf_ir_speed.c 2023-05-11 08:18:35.000000000 +0800
@@ -63,6 +63,9 @@
Program_t *program;
unsigned elementIndex;
+ if (!(programIndex % 100))
+ printf("##programIndex: %u\n", programIndex);
+
CS(program = tsf_region_create(sizeof(Program_t)));
program->globals.len = numDecls + numDefns;