commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
d0b4c76262338624782cca4d6f664df1a335456e | Jakob Stoklund Olesen | 2017-10-06T16:20:39 | Use a non-allocating sort algorithm.
The sort_unstable* functions are available in stable Rust now. These
functions never allocate memory. | diff --git a/lib/cretonne/src/regalloc/spilling.rs b/lib/cretonne/src/regalloc/spilling.rs
index 4fe14a952..a4fb4eded 100644
--- a/lib/cretonne/src/regalloc/spilling.rs
+++ b/lib/cretonne/src/regalloc/spilling.rs
@@ -356,9 +356,8 @@ impl<'a> Context<'a> {
// Leave `self.reg_uses` empty.
fn process_reg_uses(&m... | 1 | 2 | 3 |
f90e7ade86ada1a8431ac9318935738e779f7417 | Dan Gohman | 2017-10-06T01:01:27 | Enable the cretonne verifier by default in debug builds. | diff --git a/src/main.rs b/src/main.rs
index 8d7f8440f..ee72b7e23 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -42,6 +42,7 @@ use docopt::Docopt;
use std::path::Path;
use std::process::{exit, Command};
use tempdir::TempDir;
+use cretonne::settings::Configurable;
macro_rules! vprintln {
($x: expr, $($tts:tt)... | 1 | 7 | 0 |
b562fdcd5cb637c8c42aae7ba048b248cb3318d9 | Jakob Stoklund Olesen | 2017-10-05T21:46:34 | Remove the dfg::resolve_copies() method.
This method was important back when result values couldn't be moved
between instructions. Now that results can be moved, value aliases do
everything we need.
Copy instructions are still used to break interferences in the register
allocator's coalescing phase, but there isn't r... | diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs
index 25859535b..dbb643e7f 100644
--- a/lib/cretonne/src/ir/dfg.rs
+++ b/lib/cretonne/src/ir/dfg.rs
@@ -4,7 +4,7 @@ use entity::{PrimaryMap, EntityMap};
use isa::TargetIsa;
use ir::builder::{InsertBuilder, ReplaceBuilder};
use ir::extfunc::ExtFuncD... | 2 | 3 | 32 |
30aeb5708342de0e913699eba3281e7eb4b7639d | Jakob Stoklund Olesen | 2017-10-05T19:42:19 | Add a value location verifier.
This is a verification pass that can be run after register allocation.
It verifies that value locations are consistent with constraints on
their uses, and that the register diversions are consistent.
Make it clear that register diversions are local to an EBB only. This
affects what bran... | diff --git a/cranelift/src/filetest/binemit.rs b/cranelift/src/filetest/binemit.rs
index da0e2012a..ae1c741d1 100644
--- a/cranelift/src/filetest/binemit.rs
+++ b/cranelift/src/filetest/binemit.rs
@@ -116,6 +116,7 @@ impl SubTest for TestBinEmit {
// Give an encoding to any instruction that doesn't already hav... | 7 | 350 | 5 |
e4ef2cbf22155a6955fe9b6d17f4d1188f38daa0 | Dan Gohman | 2017-10-05T17:05:53 | Support ISA-specific settings in the `--isa` command-line option. | diff --git a/cranelift/src/utils.rs b/cranelift/src/utils.rs
index c9cae4cd5..b243b8953 100644
--- a/cranelift/src/utils.rs
+++ b/cranelift/src/utils.rs
@@ -104,10 +104,14 @@ pub fn parse_sets_and_isa(
let mut words = flag_isa.trim().split_whitespace();
// Look for `isa foo`.
if let Some(isa_name) = word... | 1 | 5 | 1 |
9f7d0a659cf1e0569215b00065167e4f02322194 | Dan Gohman | 2017-10-05T16:01:38 | Use VmCtx arg for globals, and a global for the heap.
This replaces the ReservedReg strategy, and is more flexible. | diff --git a/lib/runtime/src/lib.rs b/lib/runtime/src/lib.rs
index 1f26c578e..3c2125247 100644
--- a/lib/runtime/src/lib.rs
+++ b/lib/runtime/src/lib.rs
@@ -11,8 +11,9 @@ extern crate cton_wasm;
use cton_wasm::{FunctionIndex, GlobalIndex, TableIndex, MemoryIndex, Global, GlobalInit, Table,
Memory, Was... | 1 | 61 | 21 |
b5732bc20070c39e52bff6ebe28c7927afce836d | Dan Gohman | 2017-10-05T15:49:32 | On error, always print the error message and exit with non-zero status. | diff --git a/src/main.rs b/src/main.rs
index a5c7d2733..8d7f8440f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,7 +40,7 @@ use std::io::stdout;
use std::io::prelude::*;
use docopt::Docopt;
use std::path::Path;
-use std::process::Command;
+use std::process::{exit, Command};
use tempdir::TempDir;
macro_rules! ... | 1 | 4 | 3 |
826d4062fb9044d2f2a82c7ac56a2a2531ec3a0d | Jakob Stoklund Olesen | 2017-10-04T23:33:50 | Apply register diversions during binemit tests.
When "binemit" tests encode instructions, keep track of the current set
of register diversions, and use the diverted locations to check operand
constraints.
This matches how constraints are applied during a real binemit phase. | diff --git a/cranelift/src/filetest/binemit.rs b/cranelift/src/filetest/binemit.rs
index f1a493c74..da0e2012a 100644
--- a/cranelift/src/filetest/binemit.rs
+++ b/cranelift/src/filetest/binemit.rs
@@ -114,6 +114,7 @@ impl SubTest for TestBinEmit {
let is_compressed = isa.flags().is_compressed();
// ... | 3 | 37 | 5 |
d4aeec6ecee81f806dfea94e8f850a12cf116da1 | Jakob Stoklund Olesen | 2017-10-04T19:13:25 | Generalize RegDiversions to track stack locations too.
For emergency spilling, we need to be able to temporarily divert an SSA
value to a stack slot if there are no available registers. | diff --git a/lib/cretonne/src/regalloc/coloring.rs b/lib/cretonne/src/regalloc/coloring.rs
index 3bf8a34fc..9a92df027 100644
--- a/lib/cretonne/src/regalloc/coloring.rs
+++ b/lib/cretonne/src/regalloc/coloring.rs
@@ -547,7 +547,14 @@ impl<'a> Context<'a> {
if pred(lr, &self.cur.func) {
if ... | 2 | 69 | 39 |
e32aa8ab606590f4494619bf50f7580959a9e6d6 | Jakob Stoklund Olesen | 2017-10-04T01:04:56 | Emergency spilling for the solver's move scheduler.
The register constraint solver schedules a set of move instructions to
execute before the instruction getting colored. In extreme cases, this
is not possible because there are no available registers to break cycles
in the register assignments that must be scheduled.
... | diff --git a/lib/cretonne/src/isa/registers.rs b/lib/cretonne/src/isa/registers.rs
index 961aae9c8..b8e7fe114 100644
--- a/lib/cretonne/src/isa/registers.rs
+++ b/lib/cretonne/src/isa/registers.rs
@@ -209,6 +209,13 @@ impl fmt::Debug for RegClassData {
}
}
+/// Within an ISA, register classes are uniquely ident... | 3 | 341 | 47 |
7410ddfe08e7c10d50360a33306a7fafe2ee9e94 | Dan Gohman | 2017-10-04T23:55:14 | Use the WasmRuntime's signature list rather than keeping a separate list.
This way, if the runtime modifies the signature, such as to add special
arguments, they are reflected in the resulting function defintions. | diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs
index b9df83f9f..7966bdd54 100644
--- a/lib/wasm/src/module_translator.rs
+++ b/lib/wasm/src/module_translator.rs
@@ -39,7 +39,6 @@ pub fn translate_module(
}
ref s => panic!("modules should begin properly: {:?}", s),
... | 4 | 11 | 8 |
196795017bae358a0ae53fb9db3408a8c430657d | Dan Gohman | 2017-10-03T18:46:51 | Tidy up handling of the DummyRuntime. | diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs
index 840f10848..1c853efaf 100644
--- a/cranelift/src/wasm.rs
+++ b/cranelift/src/wasm.rs
@@ -4,7 +4,7 @@
//! IL. Can also executes the `start` function of the module by laying out the memories, globals
//! and tables, then emitting the translated code with h... | 1 | 2 | 5 |
c8e015f31acd7adb8caa70aaafe1bcd94ce1e5a9 | Dan Gohman | 2017-10-04T19:32:45 | Remove an unused argument. | diff --git a/src/main.rs b/src/main.rs
index bf5b027fd..a5c7d2733 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -186,15 +186,7 @@ fn handle_module(args: &Args, path: PathBuf, name: &str, isa: &TargetIsa) -> Res
if args.flag_print {
let mut writer1 = stdout();
let mut writer2 = stdout();
- ... | 1 | 1 | 10 |
fc857a758e1a66c637a3a47504f908eea2418c78 | Dan Gohman | 2017-10-04T19:21:49 | Remove an unneeded block. | diff --git a/src/main.rs b/src/main.rs
index bfd264d30..bf5b027fd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -363,18 +363,16 @@ fn pretty_print_translation(
}
_ => panic!("wrong content in code section"),
}
- {
- loop {
- match parser.read() {
- ... | 1 | 10 | 12 |
b4e7e918ccbaaa5a83124c3addbbb918f57e29db | Dan Gohman | 2017-10-04T19:18:14 | Use the correct index for printing function definitions when imports are present. | diff --git a/src/main.rs b/src/main.rs
index 538a681e4..bfd264d30 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -326,7 +326,6 @@ fn pretty_print_translation(
let mut terminal = term::stdout().unwrap();
let mut parser = Parser::new(data);
let mut parser_writer = Writer::new(writer_wat);
- let imports_c... | 1 | 2 | 6 |
6ded83332f458477ba38ba56c799ec99aed8aa38 | Dan Gohman | 2017-10-03T21:02:41 | Change the reloc sink to use vectors instead of hash maps. | diff --git a/lib/wasm2obj/src/emit_module.rs b/lib/wasm2obj/src/emit_module.rs
index 9e4ec1da9..1caf3d269 100644
--- a/lib/wasm2obj/src/emit_module.rs
+++ b/lib/wasm2obj/src/emit_module.rs
@@ -9,7 +9,6 @@ use cretonne::ir::entities::AnyEntity;
use cretonne::ir::{self, Ebb, FuncRef, JumpTable, Function};
use cretonne:... | 1 | 9 | 10 |
739d414d18719983841e709afcc4414d264115bf | Jakob Stoklund Olesen | 2017-10-03T20:14:07 | Convert regalloc::coloring to use an EncCursor.
No functional change intended, this is just a big fight with the borrow
checker. | diff --git a/lib/cretonne/src/regalloc/coloring.rs b/lib/cretonne/src/regalloc/coloring.rs
index ce6e22f75..83ecddb0c 100644
--- a/lib/cretonne/src/regalloc/coloring.rs
+++ b/lib/cretonne/src/regalloc/coloring.rs
@@ -42,10 +42,10 @@
//!
//! The exception is the entry block whose arguments are colored from the ABI req... | 1 | 161 | 205 |
412fedcc6d39a9de88b78a52adb0d78ba8565ca9 | Dan Gohman | 2017-10-03T20:30:12 | Fix reseting of the heap when compiling a module containing multiple functions. | diff --git a/lib/wasmstandalone/src/standalone.rs b/lib/wasmstandalone/src/standalone.rs
index 31dbfe3d8..7ab7afece 100644
--- a/lib/wasmstandalone/src/standalone.rs
+++ b/lib/wasmstandalone/src/standalone.rs
@@ -334,6 +334,7 @@ impl WasmRuntime for Runtime {
self.has_current_memory = None;
self.has_g... | 1 | 1 | 0 |
31a962fa1bcdbee952a44b32f721d61ee05e5752 | Dan Gohman | 2017-10-03T20:25:37 | Support multiple globals. | diff --git a/lib/wasmstandalone/src/standalone.rs b/lib/wasmstandalone/src/standalone.rs
index 0ae1938d3..31dbfe3d8 100644
--- a/lib/wasmstandalone/src/standalone.rs
+++ b/lib/wasmstandalone/src/standalone.rs
@@ -76,6 +76,8 @@ pub struct Runtime {
pub func_indices: EntityMap<FuncRef, FunctionIndex>,
the_hea... | 1 | 5 | 5 |
865a3d9f31371ad88ac0926f2cf4b12d325be91c | Dan Gohman | 2017-10-03T19:59:43 | Rename wasmstandalone::StandaloneRuntime to wasmstandalone::Runtime. | diff --git a/lib/wasm2obj/src/emit_module.rs b/lib/wasm2obj/src/emit_module.rs
index 63a12b90e..9e4ec1da9 100644
--- a/lib/wasm2obj/src/emit_module.rs
+++ b/lib/wasm2obj/src/emit_module.rs
@@ -12,7 +12,7 @@ use cton_wasm::TranslationResult;
use std::collections::HashMap;
use std::fmt::Write;
use faerie::Artifact;
-u... | 6 | 16 | 16 |
db88701eaacdfe65bde8211f572ca4741aa6f3a3 | Dan Gohman | 2017-10-03T19:54:35 | Use `Self`. | diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs
index 400a7b490..e56b89e1f 100644
--- a/lib/wasmstandalone/src/execution.rs
+++ b/lib/wasmstandalone/src/execution.rs
@@ -45,8 +45,8 @@ impl RelocSink for StandaloneRelocSink {
}
impl StandaloneRelocSink {
- fn new() -> Standa... | 1 | 2 | 2 |
97b877bb9c9217452e7d246f5f61a89dd9d55e39 | Dan Gohman | 2017-10-03T19:53:28 | Use Option::unwrap_or_else. | diff --git a/lib/wasmstandalone/src/standalone.rs b/lib/wasmstandalone/src/standalone.rs
index 793d60840..3a4505706 100644
--- a/lib/wasmstandalone/src/standalone.rs
+++ b/lib/wasmstandalone/src/standalone.rs
@@ -187,21 +187,18 @@ impl FuncEnvironment for StandaloneRuntime {
self.the_heap.unwrap(),
... | 1 | 24 | 30 |
d4438f4006c62fe53f2668cf20dce131006fad93 | Dan Gohman | 2017-10-03T19:48:33 | Drop an unneeded dependency. | diff --git a/lib/wasm2obj/Cargo.toml b/lib/wasm2obj/Cargo.toml
index 3b61e7f84..3e663acd3 100644
--- a/lib/wasm2obj/Cargo.toml
+++ b/lib/wasm2obj/Cargo.toml
@@ -6,7 +6,6 @@ publish = false
[dependencies]
cretonne = { git = "https://github.com/stoklund/cretonne.git" }
-cretonne-frontend = { git = "https://github.com... | 2 | 0 | 2 |
6c4bbc643c02588c8dce4021cd1b6f11b2cb3bed | Dan Gohman | 2017-10-03T19:39:52 | Set the faerie target based on the cretonne target. | diff --git a/src/wasm2obj.rs b/src/wasm2obj.rs
index f615957eb..9b6ac0a49 100644
--- a/src/wasm2obj.rs
+++ b/src/wasm2obj.rs
@@ -16,6 +16,7 @@ extern crate faerie;
use cton_wasm::translate_module;
use cretonne::settings;
+use cretonne::isa;
use wasm2obj::emit_module;
use std::path::PathBuf;
use std::fs::File;
@@... | 1 | 17 | 3 |
a68b2619bdc9a307fa210ba52587bed581d7f86a | Dan Gohman | 2017-10-03T19:23:59 | Sniff the wasm magic bytes, rather than relying on the filename extension. | diff --git a/src/main.rs b/src/main.rs
index 6b0240038..1c7bbd790 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -91,7 +91,7 @@ struct Args {
flag_print: bool,
}
-fn read_wasm_file(path: PathBuf) -> Result<Vec<u8>, io::Error> {
+fn read_to_end(path: PathBuf) -> Result<Vec<u8>, io::Error> {
let mut buf: Vec<... | 1 | 22 | 42 |
e5ed1517ce2d2b32969d2bd2a3ea16a18ce21277 | Dan Gohman | 2017-10-03T19:21:09 | Fix the command name in the usage message. | diff --git a/src/main.rs b/src/main.rs
index 02d4cb16b..6b0240038 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -65,9 +65,9 @@ The translation is dependent on the runtime chosen.
The default is a dummy runtime that produces placeholder values.
Usage:
- wasmstandalone-util [-vcop] <file>...
- wasmstandalone-ut... | 1 | 3 | 3 |
324a395a95de0f12f124b1469dc91854676e01fd | Dan Gohman | 2017-10-03T19:20:37 | Make the "wat2wasm" error message not panic. | diff --git a/src/main.rs b/src/main.rs
index e9caec11c..02d4cb16b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -163,8 +163,7 @@ fn handle_module(args: &Args, path: PathBuf, name: &str, isa: &TargetIsa) -> Res
return Err(String::from("wat2wasm not found"));
} else {... | 1 | 1 | 2 |
cad7e501065a92e5f5c6cbd29214bea12baf8673 | Dan Gohman | 2017-10-03T19:18:18 | Update to wasmparser 0.11.2. | diff --git a/Cargo.toml b/Cargo.toml
index d8278d9cc..e74552e04 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ cretonne-wasm = { git = "https://github.com/stoklund/cretonne.git" }
cretonne-native = { git = "https://github.com/stoklund/cretonne.git" }
wasmstandalone = { path = "lib/wasmstandalone" }
wasm2... | 1 | 1 | 1 |
374ed3a07b0c1a91b3ef5a3e53e071cdb7d0115b | Dan Gohman | 2017-10-03T18:03:06 | Fix dominator-tree queries on unreachable nodes. | diff --git a/lib/cretonne/src/dominator_tree.rs b/lib/cretonne/src/dominator_tree.rs
index 5f342baf8..7454cc084 100644
--- a/lib/cretonne/src/dominator_tree.rs
+++ b/lib/cretonne/src/dominator_tree.rs
@@ -149,7 +149,10 @@ impl DominatorTree {
// Run a finger up the dominator tree from b until we see a.
... | 1 | 33 | 1 |
d585f094236de21b80c7f27e8d0e71995479754e | Dan Gohman | 2017-10-03T17:05:46 | Don't silently swallow lexer errors. | diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs
index be8630264..e334319e9 100644
--- a/lib/reader/src/parser.rs
+++ b/lib/reader/src/parser.rs
@@ -807,6 +807,11 @@ impl<'a> Parser<'a> {
while self.token().is_some() {
list.push(self.parse_function(unique_isa)?);
}
+ ... | 1 | 5 | 0 |
d857aacec3ecf6ee9a20d449a8c4739044d82100 | Dan Gohman | 2017-10-03T16:19:55 | Sniff the wasm magic bytes, rather than relying on the filename extension. | diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs
index d6bf98110..840f10848 100644
--- a/cranelift/src/wasm.rs
+++ b/cranelift/src/wasm.rs
@@ -11,7 +11,6 @@ use cretonne::settings::FlagsOrIsa;
use std::fs::File;
use std::error::Error;
use std::io;
-use std::io::prelude::*;
use std::path::Path;
use std::p... | 1 | 21 | 36 |
ba14499fe90e5da7599160333e7415286e3e3c02 | Dan Gohman | 2017-10-03T16:09:48 | Factor out the code for reading a file into a utility function. | diff --git a/cranelift/src/utils.rs b/cranelift/src/utils.rs
index 6a962d04f..c9cae4cd5 100644
--- a/cranelift/src/utils.rs
+++ b/cranelift/src/utils.rs
@@ -20,6 +20,14 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
Ok(buffer)
}
+/// Read an entire file into a vector of bytes.
+pub fn... | 2 | 13 | 12 |
f0644186521618024ab04ffd78287f404fe1f50f | Dan Gohman | 2017-10-03T16:05:23 | Refactor set/isa parsing into a utility function. | diff --git a/cranelift/src/compile.rs b/cranelift/src/compile.rs
index 2db5d21f8..f9f718685 100644
--- a/cranelift/src/compile.rs
+++ b/cranelift/src/compile.rs
@@ -2,18 +2,12 @@
//!
//! Reads IR files into Cretonne IL and compiles it.
-use cton_reader::{parse_options, Location, parse_functions};
+use cton_reader::... | 3 | 60 | 69 |
12ab4cd9148a88b6e38466aaf901bb6187ebb15c | Dan Gohman | 2017-10-03T13:46:38 | Add a cton-util compile command. | diff --git a/cranelift/src/compile.rs b/cranelift/src/compile.rs
new file mode 100644
index 000000000..2db5d21f8
--- /dev/null
+++ b/cranelift/src/compile.rs
@@ -0,0 +1,82 @@
+//! CLI tool to compile cretonne IL into native code.
+//!
+//! Reads IR files into Cretonne IL and compiles it.
+
+use cton_reader::{parse_opti... | 2 | 87 | 0 |
7c7b1651d89f2f968f337e78b1aa14abdb9eb2fd | Dan Gohman | 2017-10-02T23:57:14 | Do a full compile in 'cton-util wasm'.
This removes the `optimize` option, as one can do that with
`--set`, eg. `--set opt_level=best`. And it adds an option to
print the compilation output.
And, it enables simple_gvn and licm for opt_level=best. | diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs
index cd402873e..4b62721ff 100644
--- a/lib/cretonne/src/context.rs
+++ b/lib/cretonne/src/context.rs
@@ -18,7 +18,7 @@ use isa::TargetIsa;
use legalize_function;
use regalloc;
use result::{CtonError, CtonResult};
-use settings::FlagsOrIsa;
+use ... | 1 | 7 | 1 |
25b8b45a415196be0b4ebcc54c9d5c26dc13339e | Dan Gohman | 2017-10-03T16:34:41 | Avoid unnecessary BufReaders. | diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs
index dc9c6ba18..81331faa4 100644
--- a/cranelift/src/wasm.rs
+++ b/cranelift/src/wasm.rs
@@ -13,7 +13,6 @@ use cretonne::isa::{self, TargetIsa};
use std::fs::File;
use std::error::Error;
use std::io;
-use std::io::BufReader;
use std::io::prelude::*;
use s... | 2 | 4 | 8 |
eba55cb1da8044b33dbff273403f4fd5bf21997d | Dan Gohman | 2017-10-03T16:31:42 | Make the "wat2wasm" error message not panic. | diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs
index 7f18130d6..dc9c6ba18 100644
--- a/cranelift/src/wasm.rs
+++ b/cranelift/src/wasm.rs
@@ -139,8 +139,7 @@ fn handle_module(
return Err(String::from("wat2wasm not found"));
} else {
... | 1 | 1 | 2 |
1efa670f6040e1dc9b0496ff67b968e0149adde9 | Dan Gohman | 2017-10-02T23:57:14 | Do a full compile in 'cton-util wasm'.
This removes the `optimize` option, as one can do that with
`--set`, eg. `--set opt_level=best`. And it adds an option to
print the compilation output. | diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs
index fbb0603cf..ac0a25c69 100644
--- a/cranelift/src/cton-util.rs
+++ b/cranelift/src/cton-util.rs
@@ -30,13 +30,16 @@ Usage:
cton-util cat <file>...
cton-util filecheck [-v] <file>
cton-util print-cfg <file>...
- cton-util wasm [-c... | 2 | 50 | 44 |
5b0a083124074dde0ccb6f559cda031d2339f0da | Dan Gohman | 2017-10-03T13:51:49 | Avoid unnecessary BufReaders. | diff --git a/src/main.rs b/src/main.rs
index e0d372812..e9caec11c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -35,7 +35,7 @@ use cretonne::settings;
use std::fs::File;
use std::error::Error;
use std::io;
-use std::io::{BufReader, stdout};
+use std::io::stdout;
use std::io::prelude::*;
use docopt::Docopt;
use st... | 2 | 5 | 8 |
3a34c35f953b5fe1bd6c4621072fb9c862748d6f | Jakob Stoklund Olesen | 2017-10-02T21:43:30 | Don't swap the arguments to the select instruction.
Both WebAssembly and Cretonne use true-value, false-value. | diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs
index 39a1d2725..24eae598a 100644
--- a/lib/wasm/src/code_translator.rs
+++ b/lib/wasm/src/code_translator.rs
@@ -95,7 +95,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
}
Operator::Select => {
l... | 1 | 1 | 1 |
50ccd000a94cc7d701ae148a4deab862226fa545 | Jakob Stoklund Olesen | 2017-09-29T19:41:37 | Implement branch relaxation.
Now that we have the legal_encodings iterator, it is simpler to find an
alternative branch encoding with a better range. | diff --git a/lib/cretonne/src/binemit/relaxation.rs b/lib/cretonne/src/binemit/relaxation.rs
index 6ae9b4e4f..4e6d1a240 100644
--- a/lib/cretonne/src/binemit/relaxation.rs
+++ b/lib/cretonne/src/binemit/relaxation.rs
@@ -80,7 +80,8 @@ pub fn relax_branches(func: &mut Function, isa: &TargetIsa) -> Result<CodeOffset
... | 1 | 25 | 2 |
2888ff5bf35ecd9984a97cd2c6bf91f6092885d3 | Jakob Stoklund Olesen | 2017-09-28T21:24:39 | Fix a corner case in fcvt_to_sint.i32.f64 legalization.
An f64 can represent multiple values in the range INT_MIN-1 < x <=
INT_MIN which all truncate to INT_MIN, so comparing the input value
against INT_MIN is not good enough.
Instead, detect overflow on x <= INT_MIN-1 when INT_MIN-1 is an exact
floating point value. | diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/cretonne/src/ir/immediates.rs
index d13887e4b..ecaa6d5e4 100644
--- a/lib/cretonne/src/ir/immediates.rs
+++ b/lib/cretonne/src/ir/immediates.rs
@@ -6,11 +6,9 @@
//! module in the meta language.
use std::fmt::{self, Display, Formatter};
-use std::{i32, u32};
-use ... | 2 | 19 | 13 |
979a22f548df7c624a269482b5a190bb4d6c7c94 | Jakob Stoklund Olesen | 2017-09-28T18:26:37 | Add pow2() and neg() methods for the IEEE immediate types.
These are convenient methods for creating common floating point
constants. | diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/cretonne/src/ir/immediates.rs
index bf9d4bea7..d13887e4b 100644
--- a/lib/cretonne/src/ir/immediates.rs
+++ b/lib/cretonne/src/ir/immediates.rs
@@ -529,6 +529,23 @@ impl Ieee32 {
Ieee32(x)
}
+ /// Create an `Ieee32` number representing 2.0^n.
+ ... | 1 | 56 | 0 |
1d481d78978a6b36c9612341dab2a04aaca42ca6 | Jakob Stoklund Olesen | 2017-09-27T23:27:49 | Use the ThreadId to name cretonne.dbg in unnamed threads.
Don't use a single cretonne.dbg log file when there are multiple unnamed
threads logging. They will clobber each other. | diff --git a/lib/cretonne/src/dbg.rs b/lib/cretonne/src/dbg.rs
index 9bd5500e3..5acadd209 100644
--- a/lib/cretonne/src/dbg.rs
+++ b/lib/cretonne/src/dbg.rs
@@ -9,7 +9,6 @@
/// The output will appear in files named `cretonne.dbg.*`, where the suffix is named after the
/// thread doing the logging.
-use std::ascii::... | 1 | 13 | 12 |
de9b1d1004bb127075e16579639ab5bb1c6bd306 | Jakob Stoklund Olesen | 2017-09-27T18:20:45 | Enable debug assertions for cretonne-tools.
The cton-util executable is used in --release mode to run the file
tests. We want assertions enabled for that.
This doesn't affect the compiler flags used to build the Cretonne crate
when it is used as a dependency in another project. | diff --git a/cranelift/Cargo.toml b/cranelift/Cargo.toml
index c576d3990..45b39ef0a 100644
--- a/cranelift/Cargo.toml
+++ b/cranelift/Cargo.toml
@@ -27,3 +27,11 @@ tempdir="0.3.5"
term = "0.4.6"
[workspace]
+
+# Enable debug assertions and parallel compilation when building cretonne-tools
+# since they are for test... | 1 | 8 | 0 |
d13f29cfe4716f00dc57f0aa49733f7112fced21 | Dan Gohman | 2017-09-26T21:56:33 | Update to wasmparser 0.11.2. | diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml
index 1bd44219c..97c63ff36 100644
--- a/lib/wasm/Cargo.toml
+++ b/lib/wasm/Cargo.toml
@@ -11,7 +11,7 @@ license = "Apache-2.0"
name = "cton_wasm"
[dependencies]
-wasmparser = "0.10.0"
+wasmparser = "0.11.2"
cretonne = { path = "../cretonne" }
cretonne-fronten... | 2 | 4 | 4 |
36585ddc4ff0a7b6baebf4d68a5666bd02d0bb47 | Dan Gohman | 2017-09-25T19:48:31 | Wasm control stack entries only need the number of return types.
This eliminates heap-allocated vectors which stored the actual types. | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index 376f798dd..53b33334e 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -129,12 +129,10 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short
// If the user has supplied jump argume... | 4 | 44 | 46 |
55e48ce7aa4c64db5f29f1df2ece053fcfe97435 | Dan Gohman | 2017-09-25T19:11:56 | Simplify translate_type's return type. | diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs
index c66f9cea7..8af012741 100644
--- a/lib/wasm/src/code_translator.rs
+++ b/lib/wasm/src/code_translator.rs
@@ -122,7 +122,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
if let Ok(ty_cre) = type_to_type(&ty) {
... | 2 | 9 | 9 |
14d6d1117de5fecff6271fe475fb0aa711e8f6fe | Dan Gohman | 2017-09-21T21:50:28 | Clean up unneeded '&'s. | diff --git a/cranelift/src/filetest/concurrent.rs b/cranelift/src/filetest/concurrent.rs
index 1d7de213f..430fb5414 100644
--- a/cranelift/src/filetest/concurrent.rs
+++ b/cranelift/src/filetest/concurrent.rs
@@ -136,7 +136,7 @@ fn worker_thread(
}
});
- if let &Er... | 3 | 4 | 4 |
e64eb79aaf7627fd32e7b1cfd1dfea29d0b945ed | Dan Gohman | 2017-09-23T22:37:48 | Fix dependency paths. wasmstandalone no longer depends on out-of-tree patches. | diff --git a/Cargo.toml b/Cargo.toml
index 47045d1b6..d8278d9cc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,11 +17,11 @@ name = "wasm2obj"
path = "src/wasm2obj.rs"
[dependencies]
-cretonne = { path = "/home/sunfish/rust/cretonne/lib/cretonne" }
-cretonne-frontend = { path = "/home/sunfish/rust/cretonne/lib/fron... | 9 | 39 | 31 |
666d565fd416cefd3f3ebcd5dcb430e9e3808251 | Dan Gohman | 2017-09-23T22:14:25 | Clean up unused imports. | diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs
index 5551f6f65..1baa6f151 100644
--- a/lib/wasmstandalone/src/execution.rs
+++ b/lib/wasmstandalone/src/execution.rs
@@ -1,6 +1,6 @@
use cretonne::Context;
use cretonne::settings;
-use cretonne::isa::{self, TargetIsa};
+use creton... | 3 | 5 | 9 |
06f0b00c2d1c8cc3643d023daacf87b04c646a66 | Dan Gohman | 2017-09-22T23:26:43 | Add an assert on an implemented feature rather than letting it silently fail. | diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs
index a106eaef9..5551f6f65 100644
--- a/lib/wasmstandalone/src/execution.rs
+++ b/lib/wasmstandalone/src/execution.rs
@@ -189,7 +189,10 @@ fn relocate(
write_unaligned(reloc_address as *mut i32, reloc_delta_i32);
... | 1 | 4 | 1 |
64d596005c1f10b206056c27db735286b8c5dce4 | Dan Gohman | 2017-09-22T23:21:25 | Reduce the extent of unsafe code. | diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs
index 03ed68cc8..a106eaef9 100644
--- a/lib/wasmstandalone/src/execution.rs
+++ b/lib/wasmstandalone/src/execution.rs
@@ -124,28 +124,30 @@ pub fn compile_module(
/// Jumps to the code region of memory and execute the start function... | 1 | 18 | 16 |
ecd746718b5abbc877631cac718efc2f77fd7ca8 | Dan Gohman | 2017-09-22T23:17:08 | Remove comments about manually saving callee-saved registers.
Even though Cretonne doesn't implement callee-saved registers yet,
it will, so we shouldn't need manual save/restore code when calling it. | diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs
index 02816a09c..03ed68cc8 100644
--- a/lib/wasmstandalone/src/execution.rs
+++ b/lib/wasmstandalone/src/execution.rs
@@ -142,33 +142,8 @@ pub fn execute(exec: &ExecutableCode) -> Result<(), String> {
// the Rust ABI for cal... | 1 | 0 | 25 |
4c5f584d0170716f3e0f1ea1b9b3674c5847dec9 | Dan Gohman | 2017-09-22T23:12:27 | Use debug_assert_eq! where applicable. | diff --git a/lib/wasmstandalone/src/standalone.rs b/lib/wasmstandalone/src/standalone.rs
index c1ed67a69..c83c8c94b 100644
--- a/lib/wasmstandalone/src/standalone.rs
+++ b/lib/wasmstandalone/src/standalone.rs
@@ -162,7 +162,7 @@ impl FuncEnvironment for StandaloneRuntime {
callee: ir::Value,
call_args... | 1 | 9 | 7 |
b583d75c7a354b1a5c5c940250757e06e563d1bd | Dan Gohman | 2017-09-22T23:11:11 | Fix redundant borrows. | diff --git a/lib/wasmstandalone/src/execution.rs b/lib/wasmstandalone/src/execution.rs
index 4692ca280..02816a09c 100644
--- a/lib/wasmstandalone/src/execution.rs
+++ b/lib/wasmstandalone/src/execution.rs
@@ -83,7 +83,7 @@ pub fn compile_module(
let mut functions_code = Vec::new();
for (function_index, functi... | 2 | 5 | 12 |
382415ed0cde2ce2de3a3cf54c09e675ca94a901 | Dan Gohman | 2017-09-22T23:09:10 | Fix a useless format!. | diff --git a/src/main.rs b/src/main.rs
index 021e59ea6..0e7f9f5b3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -103,7 +103,9 @@ fn read_wasm_file(path: PathBuf) -> Result<Vec<u8>, io::Error> {
fn main() {
let args: Args = Docopt::new(USAGE)
.and_then(|d| {
- d.help(true).version(Some(format!(... | 1 | 3 | 1 |
b89277d9ce002a6cc57d2ce0cb00e8d3585c74aa | Dan Gohman | 2017-09-22T22:53:26 | Rename "wast" to "wat". | diff --git a/src/main.rs b/src/main.rs
index d6a6030da..021e59ea6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -137,7 +137,7 @@ fn handle_module(args: &Args, path: PathBuf, name: &str, isa: &TargetIsa) -> Res
terminal.reset().unwrap();
let data = match path.extension() {
None => {
- retur... | 1 | 7 | 7 |
cdffc1b50a946b22dc0fc8832ff2117b7d431ba5 | Dan Gohman | 2017-09-22T20:41:12 | Roughly update for the recent Cretonne API changes.
Everything builds and simple modules run, though there's still lots more
to do. | diff --git a/Cargo.toml b/Cargo.toml
index febeeaaca..e28e3ad57 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,9 +13,10 @@ name = "wasmstandalone"
path = "src/main.rs"
[dependencies]
-cretonne = { git = "https://github.com/stoklund/cretonne.git" }
-cretonne-reader = { git = "https://github.com/stoklund/cretonne.gi... | 5 | 284 | 239 |
2946cc54d34435ce8ddf23659cd228bc614ed293 | Jakob Stoklund Olesen | 2017-09-22T15:51:55 | Add more trap codes.
These are codes that come up naturally when translating WebAssembly and
legalizing the Cretonne instruction set. | diff --git a/lib/cretonne/src/ir/trapcode.rs b/lib/cretonne/src/ir/trapcode.rs
index c9312cdff..2374c206f 100644
--- a/lib/cretonne/src/ir/trapcode.rs
+++ b/lib/cretonne/src/ir/trapcode.rs
@@ -20,12 +20,24 @@ pub enum TrapCode {
/// pages.
HeapOutOfBounds,
+ /// Other bounds checking error.
+ OutOfBou... | 1 | 25 | 1 |
a9acbd1afd8574d63cadf124c5565403ebf50d7d | Jakob Stoklund Olesen | 2017-09-21T23:43:47 | Convert the legalizer/boundary module to FuncCursor.
This is a larger refactoring because all the changes need to be done
together. Either you pass a Function reference around, or you pass
around references to the parts. There is no in between. | diff --git a/lib/cretonne/src/legalizer/boundary.rs b/lib/cretonne/src/legalizer/boundary.rs
index fe76d21d6..c7b4627af 100644
--- a/lib/cretonne/src/legalizer/boundary.rs
+++ b/lib/cretonne/src/legalizer/boundary.rs
@@ -18,10 +18,10 @@
//! intermediate state doesn't type check.
use abi::{legalize_abi_value, ValueC... | 1 | 163 | 164 |
85e4e9f511ca070832f6a7dd8fda13a139e3754f | Jakob Stoklund Olesen | 2017-09-21T15:12:53 | Assign source locations when translating WebAssembly to Cretonne.
The source locations are byte code offsets relative to the beginning of
the function. | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index 91c2b4c4e..376f798dd 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -1,5 +1,6 @@
//! A frontend for building Cretonne IL from other languages.
use cretonne::cursor::{Cursor, FuncCursor};
+use cretonne::ir;
... | 2 | 29 | 4 |
16eb689dd1f0dbbba52c947db6bb6329752b5142 | Dan Gohman | 2017-09-21T20:28:40 | Use `Self` instead of repeating the type name. | diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs
index ee4aaf3a6..90090d6d0 100644
--- a/lib/frontend/src/ssa.rs
+++ b/lib/frontend/src/ssa.rs
@@ -64,8 +64,8 @@ pub struct SideEffects {
}
impl SideEffects {
- fn new() -> SideEffects {
- SideEffects {
+ fn new() -> Self {
+ Self {
... | 1 | 2 | 2 |
e5e4b59683c055e35328208a0954413c7268d4d5 | Dan Gohman | 2017-09-21T16:39:31 | Tidy up some asserts. | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index f2ae3b692..91c2b4c4e 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -569,7 +569,6 @@ where
self.func.dfg.append_ebb_arg(dest_ebb, *ty);
}
} else {
- let dest_... | 1 | 2 | 6 |
e75558b8005c8450b9e77f21f8e2ffa1316599b0 | Dan Gohman | 2017-09-21T16:31:50 | Fix spelling of "adjustment". | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index e1cdbdf53..f2ae3b692 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -132,7 +132,7 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short
}
... | 1 | 3 | 3 |
dda82936686fa4ac884c9ce9da4eaf2fe23e0b7d | Dan Gohman | 2017-09-21T16:30:33 | Restructure code to avoid a heap allocation. | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index 82ae583e1..e1cdbdf53 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -543,14 +543,14 @@ where
fn ebb_args_adjustement(&mut self, dest_ebb: Ebb, jump_args: &[Type]) {
- let ty_to_append: Option<... | 1 | 38 | 46 |
ff18772d0e7b69989cda187d60f93d31d0635c0a | Dan Gohman | 2017-09-21T16:24:18 | Avoid a heap allocation. | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index 75c7dfe48..82ae583e1 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -138,7 +138,6 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short
None => {
// branch_dest... | 1 | 7 | 5 |
22b769b7160d1fce3000738fdd9853648b4e3a6d | Dan Gohman | 2017-09-21T04:35:34 | Convert use_var and predecessors_lookup into a state machine to avoid recursion. | diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs
index 5abd827e7..ee4aaf3a6 100644
--- a/lib/frontend/src/ssa.rs
+++ b/lib/frontend/src/ssa.rs
@@ -43,6 +43,12 @@ where
blocks: PrimaryMap<Block, BlockData<Variable>>,
// Records the basic blocks at the beginning of the `Ebb`s.
ebb_headers: En... | 1 | 121 | 44 |
9cda4eacdeab7063f918f92d2dd7fb33dcc30eb7 | Dan Gohman | 2017-09-21T00:32:12 | Minor refactor. | diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs
index 33470e965..5abd827e7 100644
--- a/lib/frontend/src/ssa.rs
+++ b/lib/frontend/src/ssa.rs
@@ -280,7 +280,7 @@ where
// If multiple predecessor we look up a use_var in each of them:
// if they all yield the same value no... | 1 | 4 | 3 |
df5ba8bbbaaa745fb4a1f9acc233b448b369c20c | Dan Gohman | 2017-09-21T05:48:55 | Correct a comment. | diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs
index cd0a6cf7f..33470e965 100644
--- a/lib/frontend/src/ssa.rs
+++ b/lib/frontend/src/ssa.rs
@@ -264,8 +264,7 @@ where
};
// TODO: avoid recursion for the calls to use_var and predecessors_lookup.
match case {
- // The... | 1 | 1 | 2 |
f524977920322a89d02bf1e3d73b3c030d80a764 | Dan Gohman | 2017-09-21T00:09:54 | Factor some logic out of seal_ebb_header_block into parts.
This allows append_jump_argument to call just the part that it needs
instead of the whole of seal_ebb_header_block, which is a nice cleanup
on its own, and it also eliminates a cycle from the static call graph. | diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs
index 0d3e00c5a..cd0a6cf7f 100644
--- a/lib/frontend/src/ssa.rs
+++ b/lib/frontend/src/ssa.rs
@@ -371,7 +371,12 @@ where
let (_, local_side_effects) = self.predecessors_lookup(func, val, var, ebb);
side_effects.append(local_side_ef... | 1 | 6 | 2 |
218959ff654446cc3c84e0867ae33912fe91f3bd | Jakob Stoklund Olesen | 2017-09-21T20:29:45 | Convert more tests to FuncCursor. | diff --git a/lib/cretonne/src/ir/builder.rs b/lib/cretonne/src/ir/builder.rs
index fa0b5c69c..4a662d9d1 100644
--- a/lib/cretonne/src/ir/builder.rs
+++ b/lib/cretonne/src/ir/builder.rs
@@ -214,53 +214,52 @@ impl<'f> InstBuilderBase<'f> for ReplaceBuilder<'f> {
#[cfg(test)]
mod tests {
- use ir::{Function, Cursor... | 2 | 39 | 40 |
1cd91b6f3086d7ca68d361319063510ea2a8afd0 | Jakob Stoklund Olesen | 2017-09-21T19:16:32 | Eliminate layout::Cursor from cton_frontend.
Replace all uses with a FuncCursor.
Avoid the anti-pattern of passing parts of a function around as
independent references. | diff --git a/lib/cretonne/src/loop_analysis.rs b/lib/cretonne/src/loop_analysis.rs
index 05ce1952f..21c612356 100644
--- a/lib/cretonne/src/loop_analysis.rs
+++ b/lib/cretonne/src/loop_analysis.rs
@@ -223,7 +223,8 @@ impl LoopAnalysis {
#[cfg(test)]
mod test {
- use ir::{Function, InstBuilder, Cursor, CursorBase... | 4 | 172 | 485 |
03dee5e44266627a97a6baf256c0d0120a883c41 | Jakob Stoklund Olesen | 2017-09-21T18:21:23 | Replace some uses of layout::Cursor with FuncCursor.
The layout::Cursor is unfortunate because it doesn't reference the whole
function. | diff --git a/lib/cretonne/src/flowgraph.rs b/lib/cretonne/src/flowgraph.rs
index d246a1fa3..d4ec4ca71 100644
--- a/lib/cretonne/src/flowgraph.rs
+++ b/lib/cretonne/src/flowgraph.rs
@@ -152,7 +152,8 @@ impl ControlFlowGraph {
#[cfg(test)]
mod tests {
use super::*;
- use ir::{Function, InstBuilder, Cursor, Curs... | 3 | 31 | 32 |
ed6630dc02b80a3c038dadfa15f0d6a38701eebf | Dan Gohman | 2017-09-20T23:37:55 | Move `verify` calls back into Context, using FlagsOrIsa.
With FlagsOrIsa, we can pass around the information we need to run
the verifier from the Context even when a TargetIsa is not available. | diff --git a/cranelift/src/filetest/licm.rs b/cranelift/src/filetest/licm.rs
index 3f3bc6cec..32be45047 100644
--- a/cranelift/src/filetest/licm.rs
+++ b/cranelift/src/filetest/licm.rs
@@ -40,8 +40,7 @@ impl SubTest for TestLICM {
comp_ctx.flowgraph();
comp_ctx.compute_loop_analysis();
- comp... | 4 | 17 | 18 |
f80ee7af3995520ef7bdb10b7c7f647ba3d1fea6 | Dan Gohman | 2017-09-20T23:14:26 | Add a "host" crate for autodetecting the host. (#159)
* Add a "native" crate for autodetecting the host.
* Remove the redundant .gitignore.
* Use the proper builder for enabling subtarget flags. | diff --git a/cranelift/Cargo.toml b/cranelift/Cargo.toml
index 6523a9d2d..c576d3990 100644
--- a/cranelift/Cargo.toml
+++ b/cranelift/Cargo.toml
@@ -17,6 +17,7 @@ cretonne = { path = "lib/cretonne" }
cretonne-reader = { path = "lib/reader" }
cretonne-frontend = { path = "lib/frontend" }
cretonne-wasm = { path = "lib... | 3 | 106 | 0 |
6710216e96a78bd06b049cbcd0a64d5a110af726 | Dan Gohman | 2017-09-20T19:38:13 | Add next_inst and prev_inst helper functions to Layout. | diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs
index c2c8f5ea7..213984838 100644
--- a/lib/cretonne/src/ir/layout.rs
+++ b/lib/cretonne/src/ir/layout.rs
@@ -482,6 +482,16 @@ impl Layout {
self.ebbs[ebb].last_inst.into()
}
+ /// Fetch the instruction following `inst`.
+ ... | 1 | 10 | 0 |
42af6d59bf248d5257af831dde8ad42a6264b9c0 | Dan Gohman | 2017-09-19T20:25:16 | Add a ScopedHashMap class, for use in a future GVN implementation. | diff --git a/lib/cretonne/src/lib.rs b/lib/cretonne/src/lib.rs
index 6949f92f5..8fb1c393d 100644
--- a/lib/cretonne/src/lib.rs
+++ b/lib/cretonne/src/lib.rs
@@ -38,6 +38,7 @@ mod licm;
mod partition_slice;
mod predicates;
mod ref_slice;
+mod scoped_hash_map;
mod simple_gvn;
mod stack_layout;
mod topo_order;
diff ... | 2 | 223 | 0 |
74845fed6c409cf37a07df4090d090c1c2ceaf3f | Dan Gohman | 2017-09-20T18:19:35 | Use more helper functions on `CursorBase` to reduce cursor repositioning. | diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs
index b92a6d733..c2c8f5ea7 100644
--- a/lib/cretonne/src/ir/layout.rs
+++ b/lib/cretonne/src/ir/layout.rs
@@ -720,6 +720,29 @@ pub trait CursorBase {
self
}
+ /// Rebuild this cursor positioned at the first insertion point for... | 6 | 139 | 79 |
482439c94b4f2ea806e04b81136eb24f5b2228d9 | Dan Gohman | 2017-09-20T16:55:01 | Minor code cleanups in simple_gvn's main loop.
Redundant load/store elimination isn't critical for the use case of
optimizing wasm code which has already been optimized, so remove the
TODO for that for now. | diff --git a/lib/cretonne/src/simple_gvn.rs b/lib/cretonne/src/simple_gvn.rs
index 40d0ecf52..20e229844 100644
--- a/lib/cretonne/src/simple_gvn.rs
+++ b/lib/cretonne/src/simple_gvn.rs
@@ -7,8 +7,9 @@ use std::collections::HashMap;
/// Test whether the given opcode is unsafe to even consider for GVN.
fn trivially_u... | 1 | 5 | 13 |
b888894fbb1721990f4b006ece790dd770ccca5b | Dan Gohman | 2017-09-20T13:58:45 | Use `CursorBase` utility functions to reduce repositioning clutter. | diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs
index 5c908812c..b92a6d733 100644
--- a/lib/cretonne/src/ir/layout.rs
+++ b/lib/cretonne/src/ir/layout.rs
@@ -788,10 +788,27 @@ pub trait CursorBase {
self.set_position(CursorPosition::At(inst));
}
+ /// Go to the position for... | 5 | 22 | 9 |
144d39a53dec9b0dbfc145e65caf3bccaf230512 | Dan Gohman | 2017-09-19T21:04:03 | Minor code simplification. | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index 86a91ae97..98ef98ac6 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -260,10 +260,7 @@ where
let basic_block = self.builder.ssa.header_block(ebb);
// Then we change the cursor position.
- ... | 1 | 1 | 4 |
5194298d9b3ccd7b61d0f29d72d5efc00a0af802 | Dan Gohman | 2017-09-19T21:03:54 | Fix a typo in a comment. | diff --git a/lib/cretonne/src/loop_analysis.rs b/lib/cretonne/src/loop_analysis.rs
index 4deedbd56..05ce1952f 100644
--- a/lib/cretonne/src/loop_analysis.rs
+++ b/lib/cretonne/src/loop_analysis.rs
@@ -157,7 +157,7 @@ impl LoopAnalysis {
layout: &Layout,
) {
let mut stack: Vec<Ebb> = Vec::new();
-... | 1 | 1 | 1 |
0cfea8858a0dae2480e0cf9849f3b7ba995dbe20 | Jakob Stoklund Olesen | 2017-09-19T19:59:07 | Add uext() and sext() builder methods to ArgumentType.
This makes it simpler to construct arguments like:
ArgumentType::new(I32).uext() | diff --git a/lib/cretonne/src/ir/extfunc.rs b/lib/cretonne/src/ir/extfunc.rs
index 5983182d8..8b8cc9dca 100644
--- a/lib/cretonne/src/ir/extfunc.rs
+++ b/lib/cretonne/src/ir/extfunc.rs
@@ -173,6 +173,24 @@ impl ArgumentType {
}
}
+ /// Convert `self` to an argument type with the `uext` flag set.
+ ... | 1 | 21 | 2 |
da4cde8117aa1c5d2d6bf5c777c114e609ed0658 | Jakob Stoklund Olesen | 2017-09-18T18:53:32 | Always insert the entry EBB before translating any WASM.
The FuncEnvironment callbacks (make_global in particular) may need to
insert code in the entry EBB. We need to make sure the entry EBB has
been inserted in the layout before making those callbacks. | diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs
index 29a4f3f64..86a91ae97 100644
--- a/lib/frontend/src/frontend.rs
+++ b/lib/frontend/src/frontend.rs
@@ -373,7 +373,7 @@ where
}
/// Make sure that the current EBB is inserted in the layout.
- fn ensure_inserted_ebb(&mut self) {
... | 2 | 5 | 1 |
f5f37ac4a6db655bcfa3dfac4ec4f22604286059 | Dan Gohman | 2017-09-15T22:43:47 | Use FlagsOrIsa to avoid requiring a --isa argument in cton-util wasm. | diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs
index e9f9f39c3..7e9040c2c 100644
--- a/cranelift/src/wasm.rs
+++ b/cranelift/src/wasm.rs
@@ -9,7 +9,7 @@ use cton_reader::{parse_options, Location};
use std::path::PathBuf;
use cretonne::Context;
use cretonne::verifier;
-use cretonne::settings;
+use cretonn... | 1 | 28 | 20 |
24a5a02752bc164fe926317a2f73ff14fc9596be | Jakob Stoklund Olesen | 2017-09-15T17:48:53 | Add a RegDiversions::display() function.
Display the current register diversions for debugging purposes. | diff --git a/lib/cretonne/src/regalloc/diversion.rs b/lib/cretonne/src/regalloc/diversion.rs
index 103c624d5..769998de3 100644
--- a/lib/cretonne/src/regalloc/diversion.rs
+++ b/lib/cretonne/src/regalloc/diversion.rs
@@ -9,7 +9,8 @@
use entity::EntityMap;
use ir::{Value, ValueLoc};
-use isa::RegUnit;
+use isa::{Reg... | 1 | 31 | 1 |
cba7a032751b3ed21d2b5aac3e215256bbdeb20e | Jakob Stoklund Olesen | 2017-09-15T16:32:56 | Give better verifier errors for missing instruction encodings.
When possible, provide the ISA's default encoding as a suggesting for
the missing instruction encoding. | diff --git a/lib/cretonne/src/verifier/mod.rs b/lib/cretonne/src/verifier/mod.rs
index f7170bbd2..bfc45b7d0 100644
--- a/lib/cretonne/src/verifier/mod.rs
+++ b/lib/cretonne/src/verifier/mod.rs
@@ -920,28 +920,40 @@ impl<'a> Verifier<'a> {
return Ok(());
}
+ // Check if this opcode must be... | 1 | 31 | 19 |
9e77af25a36043086591a4ec2aab7daaf72fd1b9 | Dan Gohman | 2017-09-15T00:41:43 | Add settings and isa command-line options to cton-util wasm. (#158)
* Add settings and isa command-line options to cton-util wasm.
* Use map_err to simplify error handling.
* Use `&*` instead of `.borrow()`. | diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs
index e702f57ae..fbb0603cf 100644
--- a/cranelift/src/cton-util.rs
+++ b/cranelift/src/cton-util.rs
@@ -30,7 +30,7 @@ Usage:
cton-util cat <file>...
cton-util filecheck [-v] <file>
cton-util print-cfg <file>...
- cton-util wasm [-cvo... | 4 | 47 | 21 |
bbe056bf9d5f15a4effde683b3d2816525616608 | Dan Gohman | 2017-09-14T21:38:53 | Make passes assert their dependencies consistently. (#156)
* Make passes assert their dependencies consistently.
This avoids ambiguity about whose responsibility it is to run
to compute cfg, domtree, and loop_analysis data.
* Reset the `valid` flag in DominatorTree's `clear()`.
* Remove the redundant assert ... | diff --git a/cranelift/src/filetest/legalizer.rs b/cranelift/src/filetest/legalizer.rs
index 08155289c..e79aada79 100644
--- a/cranelift/src/filetest/legalizer.rs
+++ b/cranelift/src/filetest/legalizer.rs
@@ -40,7 +40,7 @@ impl SubTest for TestLegalizer {
comp_ctx.func = func.into_owned();
let isa = c... | 15 | 72 | 43 |
39992014e0bf1afba8df5c6c57d4b0d8a7916f7b | Jakob Stoklund Olesen | 2017-09-14T19:25:59 | Make FuncEnvironment callbacks take an &mut self parameter.
The WasmRuntime trait already does this, and nothing in the function
translator requires the environment trait object to be non-mutable. | diff --git a/lib/wasm/src/runtime/dummy.rs b/lib/wasm/src/runtime/dummy.rs
index b6d849d75..de630d881 100644
--- a/lib/wasm/src/runtime/dummy.rs
+++ b/lib/wasm/src/runtime/dummy.rs
@@ -47,7 +47,7 @@ impl FuncEnvironment for DummyRuntime {
&self.flags
}
- fn make_global(&self, func: &mut ir::Function,... | 3 | 19 | 19 |
78c39ce078dfd84b8fc583ea160c693fe3cb244a | Dan Gohman | 2017-09-14T16:26:37 | Don't silently ignore argument or value locations. (#157)
No current tests actually rely on this, and it's surprising. | diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs
index 2169ded9c..e5c59530f 100644
--- a/lib/reader/src/parser.rs
+++ b/lib/reader/src/parser.rs
@@ -1010,9 +1010,7 @@ impl<'a> Parser<'a> {
.map(ArgumentLoc::Reg)
.ok_or(self.error("invalid registe... | 1 | 2 | 5 |
45f50120ef631ea2a2d716697190551932b87f16 | Jakob Stoklund Olesen | 2017-09-13T19:04:14 | Handle special-purpose arguments in the Intel ABI.
The VMContext and SignatureId arguments are passed in fixed registers
for the spiderwasm calling convention. | diff --git a/lib/cretonne/src/isa/intel/abi.rs b/lib/cretonne/src/isa/intel/abi.rs
index 707d42b8d..7a051905d 100644
--- a/lib/cretonne/src/isa/intel/abi.rs
+++ b/lib/cretonne/src/isa/intel/abi.rs
@@ -6,7 +6,7 @@ use regalloc::AllocatableSet;
use settings as shared_settings;
use super::registers::{GPR, FPR, RU};
use... | 1 | 19 | 1 |
eb42a2547eb9877e4ae020aef1d548c5408d0438 | Jakob Stoklund Olesen | 2017-09-13T18:35:33 | Add helper routines for special-purpose arguments.
- ArgumentType::special() creates a new special-purpose argument without
assigning it to a register location.
- Signature::special_arg_index() funds a unique special-purpose
argument.
- Function::special_arg() finds a special-purpose argument by value.
Also add a... | diff --git a/lib/cretonne/src/ir/extfunc.rs b/lib/cretonne/src/ir/extfunc.rs
index 353d49256..5983182d8 100644
--- a/lib/cretonne/src/ir/extfunc.rs
+++ b/lib/cretonne/src/ir/extfunc.rs
@@ -76,6 +76,13 @@ impl Signature {
pub fn display<'a, R: Into<Option<&'a RegInfo>>>(&'a self, regs: R) -> DisplaySignature<'a> {
... | 3 | 44 | 1 |
ef27c3daf0d2077e9ce664f32ea9b974e3dab969 | Jakob Stoklund Olesen | 2017-09-13T16:34:05 | Add an AsRef implementation to FuncName so we can read its contents. | diff --git a/lib/cretonne/src/ir/funcname.rs b/lib/cretonne/src/ir/funcname.rs
index 2081f519e..142a846c2 100644
--- a/lib/cretonne/src/ir/funcname.rs
+++ b/lib/cretonne/src/ir/funcname.rs
@@ -82,6 +82,12 @@ impl AsRef<[u8]> for NameRepr {
}
}
+impl AsRef<[u8]> for FunctionName {
+ fn as_ref(&self) -> &[u8] ... | 1 | 6 | 0 |
f5639a66e67c8900247c4c48ad9c7c31916e9ffd | Dan Gohman | 2017-09-12T23:35:45 | Flush stdout before writing to stderr.
In particular, terminal.reset() doesn't flush, so it ensures that stderr isn't
unintentionally printed in the color of the preceding line. | diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs
index a7ad8a44b..e702f57ae 100644
--- a/cranelift/src/cton-util.rs
+++ b/cranelift/src/cton-util.rs
@@ -98,6 +98,7 @@ fn main() {
if !msg.ends_with('\n') {
msg.push('\n');
}
+ io::stdout().flush().expect("flushing... | 1 | 1 | 0 |
c7bd842ee39ce9d13f313087791a5d706ed6fdf0 | Dan Gohman | 2017-09-12T23:25:15 | Refactor code to use Context::verify instead of doing it manually. | diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs
index 4f48ae6d7..6b22d66e3 100644
--- a/cranelift/src/wasm.rs
+++ b/cranelift/src/wasm.rs
@@ -155,14 +155,17 @@ fn handle_module(
for func in &translation.functions {
let mut context = Context::new();
context.func = func.clone... | 1 | 9 | 6 |
e2f0fe58d128662a66624833619bd4dbee16b874 | Dan Gohman | 2017-09-12T23:15:22 | Move logic out of `cton-util wasm`.
Give LoopAnalysis `is_valid` and `ensure` functions similar to
DominatorTree and others, so that it can be computed on demand in the
same way.
This removes the last need for src/wasm.rs to have embedded knowledge
of the dependencies of the passes it's running. | diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs
index 350a15d51..4f48ae6d7 100644
--- a/cranelift/src/wasm.rs
+++ b/cranelift/src/wasm.rs
@@ -6,9 +6,6 @@
use cton_wasm::{translate_module, DummyRuntime, WasmRuntime};
use std::path::PathBuf;
-use cretonne::loop_analysis::LoopAnalysis;
-use cretonne::flowgr... | 3 | 23 | 16 |
9d0d6b5a1b909355c0d1906f11bfa6bae49482e2 | Dan Gohman | 2017-09-12T22:38:30 | Move `verify` calls out of Context.
Also, move flowgraph() calls out of filetest and into the passes that
need them so that filetest doesn't have embedded knowledge of these
dependencies.
This resolves a TODO about the way Context was running the verifier, and
it makes the Context functions and the filetest runners m... | diff --git a/cranelift/src/filetest/licm.rs b/cranelift/src/filetest/licm.rs
index db817530a..79b785f8c 100644
--- a/cranelift/src/filetest/licm.rs
+++ b/cranelift/src/filetest/licm.rs
@@ -38,9 +38,9 @@ impl SubTest for TestLICM {
let mut comp_ctx = cretonne::Context::new();
comp_ctx.func = func.into_... | 8 | 37 | 32 |
69f8174c03de322f7c39eb12cd778b1a18fa4453 | Dan Gohman | 2017-09-12T20:47:17 | Move `ensure_domtree` out of Context and into DominatorTree.
This also moves the calls to it out of Context and into the passes that
actually need it, so that Context's functions don't have any logic of
their own. | diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs
index ece812a5d..45914d806 100644
--- a/lib/cretonne/src/context.rs
+++ b/lib/cretonne/src/context.rs
@@ -115,13 +115,6 @@ impl Context {
self.domtree.compute(&self.func, &self.cfg);
}
- /// Ensure that a valid domtree exists.
- ... | 4 | 14 | 11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.