Commit Graph

389 Commits

Author SHA1 Message Date
284948b6d4 Refactor so as to convert ExtraInfo when potentially canonicalizing.
It seemed like a good idea at the time, but in practice we discard the extra info all or almost all of the time.

This also introduces a new bug. In an operation like multiply, it's valid to multiply two values, one with a pending NaN and one without. As written, in the SIMD case (because of the two kinds of pending in play), we assert.
2019-11-26 12:20:43 -08:00
26c8fd52c8 Initial implementation of "known to be arithmetic NaN / not NaN". 2019-11-26 12:20:43 -08:00
fafc7ad38c Add "known to not contain non-arithmetic NaNs" to ExtraInfo in LLVM backend.
Not wired up yet.
2019-11-26 12:20:43 -08:00
bb16547567 Merge branch 'ventuzelo/fix-1005-panic-sub-overflow' of github.com:pventuzelo/wasmer into ventuzelo/fix-1005-panic-sub-overflow 2019-11-26 09:18:05 +01:00
49665d5797 use checked_sub for peekn_extra 2019-11-26 09:17:13 +01:00
d376b89ef0 Merge branch 'master' into ventuzelo/fix-1005-panic-sub-overflow 2019-11-25 12:05:33 +01:00
5c1c786e35 Merge #1002
1002: Update the LLVM pass list. r=nlewycky a=nlewycky

# Description
Adds optimizations of loops, and inlinling and some simple interprocedural optimization.

Measured on the libsodium benchmarks, the new pass pipeline is a 2.35% geomean improvement. No major performance regressions known.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-23 05:11:44 +00:00
3ef9f769df Fix TBAA crash with LLVM + the gas middleware. 2019-11-22 17:03:31 -08:00
681219b06c Fix bug in LLVM lowering of 'return' when the stack has a float on it. 2019-11-22 17:03:31 -08:00
2433d365af Add new test feature, enabled in test crates.
When test feature is enabled, turn on LLVM verifier. This was previously never enabled.
2019-11-22 16:51:44 -08:00
bb1e7a8d78 Prepare for 0.11.0 release 2019-11-22 11:18:06 -08:00
2261f8b449 cargo fmt 2019-11-22 17:21:15 +01:00
508004088e check stack len before getting value 2019-11-22 17:10:54 +01:00
9fe5e261ea Update the LLVM pass list.
Adds optimizations of loops, and inlinling and some simple interprocedural optimization.
2019-11-21 22:41:23 -08:00
e568c4a374 Merge #972
972: Prepare for 0.10.2 release r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-18 19:44:33 +00:00
anb
3b2d751c55 Enable compilation for specific target
By exposing the target information through `CompilerConfig`,
compiler(only LLVM at the moment) could create a machine with
different CPU feature flags other than current host, which makes it
capable to "cross compile" to some degree.

Update #959
2019-11-15 18:51:59 -08:00
cebcb4c927 Prepare for 0.10.2 release 2019-11-15 14:55:53 -08:00
ebe8da7bd3 When accessing memory, use byte aligned accesses.
LLVM's instcombine will attempt to bump the alignment when it can prove that it's safe to do so.

Fixes #969.
2019-11-15 14:47:53 -08:00
fff16c08d0 Merge #965
965: Add categories and keywords to `Cargo.toml`s r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-13 23:47:56 +00:00
9127eaf825 Add categories and keywords to Cargo.tomls 2019-11-13 15:46:09 -08:00
89859a9ab5 Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 14:36:33 +01:00
69950d9e5f Prepare for 0.10.1 release 2019-11-11 16:22:37 -08:00
95706160ee Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 00:55:40 +01:00
bb81614be4 feat(llvm-backend) Update ImportedFunc structure.
`vm::ImportedFunc` in `runtime-core` has changed. Update LLVM accordingly.
2019-11-12 00:52:14 +01:00
0a216c0779 Prepare for 0.10.0 release 2019-11-11 12:13:53 -08:00
ed6ce4b9b4 Don't create functions for imports, we still call those indirectly. 2019-11-08 14:44:59 -08:00
2957b6abd8 Emit direct calls for local functions, but not for imports. 2019-11-08 14:44:50 -08:00
674a70fa05 Create function declarations before starting the body of the first function. 2019-11-08 13:13:58 -08:00
dccaa3a285 Apply TBAA to the correct instruction.
Another instance of the bug in PR #933.
2019-11-07 12:42:29 -08:00
203efd0c06 Apply TBAA to the correct instruction.
Caught by LLVM verifier complaining about !tbaa on a getelementptr.
2019-11-06 23:25:39 -08:00
cf74b68c37 Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-06 14:48:47 +01:00
215e4458f0 Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-06 14:48:46 +01:00
6035bd2d9b feat(runtime-core,clif-backend,llvm-backend) Rename an ImportFunc offset.
`ImportedFunc::offset_vmctx` becomes `ImportedFunc::offset_func_ctx`.
2019-11-06 14:48:46 +01:00
1d8f2b767d Build Metadata using the current Context.
Fixes #927. Reverts #928.
2019-11-04 15:27:38 -08:00
c0c7661c65 Merge branch 'master' of github.com:wasmerio/wasmer into feature/llvm-tbaa 2019-11-01 17:53:52 -07:00
132757ee9d Fix leak. Only create one NamedMDNode for each name. 2019-11-01 17:49:45 -07:00
d8888c9459 Merge #911
911: Don't emit bounds checks when the offset is known at compile time to be less than the minimum memory size. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-01 19:53:17 +00:00
20270411d9 When the const memory access is not larger than the minimum, use a runtime check.
The memory may have grown.
2019-11-01 12:49:54 -07:00
ef4b3c3428 Improve some TBAA label names, particular for memory.
Memory can't change between static and dynamic, so use that in the TBAA label
name.

Distinguish between local and imported memory, table and globals.
2019-10-31 12:40:32 -07:00
0e665c4001 Merge branch 'master' into feature/llvm-tbaa 2019-10-31 11:55:31 -07:00
0ba686ffc6 Improve wording a little. 2019-10-31 11:50:33 -07:00
88427c9696 Add some comments. 2019-10-31 11:48:52 -07:00
d10d54a416 Add TBAA to atomic ops. 2019-10-30 16:39:39 -07:00
15ce8bfda7 Label the loads in intrinsics.rs, most of which are the initial accesses off the context.
Move tbaa_label to intrinsics.rs. Move TBAA pass to first in the list, it doesn't get invalidated. Add TBAA labels for internal fields.
2019-10-30 16:18:36 -07:00
74eaec968e Remove all *_tbaa fields from LLVMModuleCodeGenerator and LLVMFunctionCodeGenerator. 2019-10-30 14:05:11 -07:00
e7d1742c63 Update module to be held by Rc<RefCell<>> so that we can pass it to LLVMFunctionCodeGenerator.
Use that to generate distinct TBAA labels for distinct local variables.
2019-10-30 13:11:29 -07:00
f77d9bfe32 Initial implementation of TBAA for the LLVM backend. 2019-10-30 10:29:51 -07:00
edb6cbefca fix(runtime-core) Share the definition of Trampoline across all the backends.
This patch updates all the backends to use the definition of
`Trampoline` as defined in the `wasmer_runtime_core::typed_func`
module. That way, there is no copy of that type, and as such, it is
easier to avoid regression (a simple `cargo check` does the job).

This patch also formats the `use` statements in the updated files.
2019-10-30 13:10:34 +01:00
7fd20e3355 NFC: Fold variable into initializer. 2019-10-29 22:23:46 -07:00
9224db6d1e Don't emit bounds checks when the offset is less than the minimum memory size. 2019-10-28 15:57:16 -07:00