Skip to content

Update dependencies #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 15, 2022
Merged

Update dependencies #81

merged 4 commits into from
Jan 15, 2022

Conversation

ghuls
Copy link
Contributor

@ghuls ghuls commented Jan 13, 2022

No description provided.

ghuls added 4 commits January 12, 2022 21:43
Update clap to 3.0 and improve argument parsing and help output:
  - Update clap from 3.0.0-beta4 to 3.0.
  - Update help output text.
  - Allow easy specifying of "-1" for -O option (allow_hyphen_values(true)).
  - Make -v var=value as last argument before program work
    without need for "--" or other argument after.
  - Make -i and -F mutually exclusive as specified field
    separator as -F is not used when parsing input files
    as CSV or TSV.
Update itoa from 0.4 to 1.0.
itoa::Buffer::new() allocates the necessary space on the stack
automatically, and usage is similar to ryu now.
Update other dependencies.
Switch to maintained version of jemallocator like rustc did in:
  rust-lang/rust#83152
@ghuls ghuls force-pushed the update_dependencies branch from e2177db to e8a6333 Compare January 13, 2022 01:53
@ghuls
Copy link
Contributor Author

ghuls commented Jan 13, 2022

cranelift can also be updated, but requires different code to print IR.
bumpalo can be updated without problems, but there is some new stuff that could be useful: https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md

mimalloc could also be added as alternative allocator.

❯  git diff Cargo.toml src/main.rs src/codegen/clif.rs
diff --git a/Cargo.toml b/Cargo.toml
index 19bbb3b..e149875 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,6 +24,7 @@ itoa = "1.0"
 ryu = "1.0"
 libc = "0.2"
 tikv-jemallocator = { version = "0.4", optional = true }
+mimalloc = { version = "0.1", default-features = false, optional = true }
 rand = "0.8.4"
 lalrpop-util = "0.19.6"
 unicode-xid = "0.2.2"
@@ -39,13 +40,13 @@ termcolor = "1.1"
 itertools = "0.10"
 assert_cmd = "2.0.3"
 paste = "1.0"
-cranelift = "0.75.0"
-cranelift-codegen = "0.75.0"
-cranelift-frontend = "0.75.0"
-cranelift-module = "0.75.0"
-cranelift-jit = "0.75.0"
+cranelift = "0.80.0"
+cranelift-codegen = "0.80.0"
+cranelift-frontend = "0.80.0"
+cranelift-module = "0.80.0"
+cranelift-jit = "0.80.0"
 fast-float = "0.2"
-bumpalo = { version = "3.6", features = ["collections"] }
+bumpalo = { version = "3.9", features = ["collections"] }
 target-lexicon = "0.12.2"
 
 [dev-dependencies]
@@ -56,6 +57,7 @@ tempfile = "3.3"
 [features]
 default = ["use_jemalloc", "allow_avx2", "llvm_backend", "unstable"]
 use_jemalloc = ["tikv-jemallocator"]
+use_mimalloc = ["mimalloc"]
 # Certain features leverage the AVX2 instruction set, but AVX2 can often make
 # the entire application slightly slower, even on chips that support it. For
 # those cases, consider disabling allow_avx2.
diff --git a/src/codegen/clif.rs b/src/codegen/clif.rs
index 94f534f..4a4a88c 100644
--- a/src/codegen/clif.rs
+++ b/src/codegen/clif.rs
@@ -573,7 +573,7 @@ impl<'a> View<'a> {
         self.builder.seal_all_blocks();
         self.builder.finalize();
         if DUMP_IR {
-            eprintln!("{}", self.builder.display(None));
+            //eprintln!("{}", self.builder.display(None));
         }
         Ok(())
     }
diff --git a/src/main.rs b/src/main.rs
index 75991aa..dc871b6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -54,6 +54,10 @@ use std::mem;
 #[global_allocator]
 static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
 
+#[cfg(feature = "use_mimalloc")]
+#[global_allocator]
+static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
+
 macro_rules! fail {
     ($($t:tt)*) => {{
         eprintln_ignore!($($t)*);

@ezrosent
Copy link
Owner

Thanks for the PR! I should have time to review this soon but I expect to merge it in the next couple of days.

@ezrosent
Copy link
Owner

I think there are a couple more things to clean up here on the LLVM side, but I can push changes post-merge. Thanks again!

@ezrosent ezrosent merged commit f14797c into ezrosent:master Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants