Skip to content

Commit

Permalink
Merge #921
Browse files Browse the repository at this point in the history
921: Apply TBAA metadata in the LLVM backend. r=nlewycky a=nlewycky

# Description
Inform LLVM that the pointers to memory, globals, locals, etc., are distinct.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <[email protected]>
Co-authored-by: nlewycky <[email protected]>
  • Loading branch information
bors[bot] and nlewycky authored Nov 2, 2019
2 parents d8888c9 + c0c7661 commit b9a9949
Show file tree
Hide file tree
Showing 5 changed files with 996 additions and 97 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## **[Unreleased]**

- [#921](https://github.com/wasmerio/wasmer/pull/921) In LLVM backend, annotate all memory accesses with TBAA metadata.
- [#883](https://github.com/wasmerio/wasmer/pull/883) Allow floating point operations to have arbitrary inputs, even including SNaNs.
- [#856](https://github.com/wasmerio/wasmer/pull/856) Expose methods in the runtime C API to get a WASI import object

Expand Down
54 changes: 32 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions lib/llvm-backend/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ use inkwell::{
use libc::c_char;
use std::{
any::Any,
cell::RefCell,
ffi::{c_void, CString},
fs::File,
io::Write,
mem,
ops::Deref,
ptr::{self, NonNull},
rc::Rc,
slice, str,
sync::{Arc, Once},
};
Expand Down Expand Up @@ -169,14 +171,14 @@ pub struct LLVMBackend {

impl LLVMBackend {
pub fn new(
module: Module,
module: Rc<RefCell<Module>>,
_intrinsics: Intrinsics,
_stackmaps: &StackmapRegistry,
_module_info: &ModuleInfo,
target_machine: &TargetMachine,
) -> (Self, LLVMCache) {
let memory_buffer = target_machine
.write_to_memory_buffer(&module, FileType::Object)
.write_to_memory_buffer(&module.borrow_mut(), FileType::Object)
.unwrap();
let mem_buf_slice = memory_buffer.as_slice();

Expand Down
Loading

0 comments on commit b9a9949

Please sign in to comment.