Skip to content

Commit

Permalink
Cleanup unused deps and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sbillig committed Jun 30, 2024
1 parent e7cb9bf commit f5d4b7c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 37 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,54 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --no-deps

fmt:
name: Rustfmt
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --workspace --all-features --all-targets -- -D clippy::all

unused_deps:
name: Unused dependencies
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Install cargo-udeps
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-udeps

- run: cargo +nightly udeps

test:
name: Test
defaults:
Expand All @@ -60,11 +79,13 @@ jobs:
- nightly

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}

- uses: Swatinem/rust-cache@v2

- name: Test
run: cargo test --workspace --all-targets --no-fail-fast

Expand Down
44 changes: 22 additions & 22 deletions crates/filecheck/fixtures/insn_simplify/or.sntn
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ target = "evm-ethereum-london"

# v0 | -1 => -1
# check: return -1.i8;
func public %or0(v0.i8) -> i8 {
func public %or0(v0.i8) -> i8 {
block0:
v1.i8 = or v0 -1.i8;
return v1;
}

# v0 | v0 => v0
# check: return v0;
func public %or1(v0.i8) -> i8 {
func public %or1(v0.i8) -> i8 {
block0:
v1.i8 = or v0 v0;
return v1;
}

# v0 | 0 => v0
# check: return v0;
func public %or2(v0.i8) -> i8 {
func public %or2(v0.i8) -> i8 {
block0:
v1.i8 = or v0 0.i8;
return v1;
}

# v0 | !v0 => -1
# check: return -1.i8;
func public %or3(v0.i8) -> i8 {
func public %or3(v0.i8) -> i8 {
block0:
v1.i8 = not v0;
v2.i8 = or v0 v1;
Expand All @@ -35,7 +35,7 @@ func public %or3(v0.i8) -> i8 {

# v0 | (v0 & v1) => v0
# check: return v0;
func public %or4(v0.i8, v1.i8) -> i8 {
func public %or4(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = and v0 v1;
v3.i8 = or v0 v2;
Expand All @@ -44,7 +44,7 @@ func public %or4(v0.i8, v1.i8) -> i8 {

# v0 | (v1 & v0) => v0
# check: return v0;
func public %or5(v0.i8, v1.i8) -> i8 {
func public %or5(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = and v1 v0;
v3.i8 = or v0 v2;
Expand All @@ -53,7 +53,7 @@ func public %or5(v0.i8, v1.i8) -> i8 {

# v0 | !(v0 & v1) => -1
# check: return -1.i8;
func public %or6(v0.i8, v1.i8) -> i8 {
func public %or6(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = and v0 v1;
v3.i8 = not v2;
Expand All @@ -63,7 +63,7 @@ func public %or6(v0.i8, v1.i8) -> i8 {

# v0 | !(v1 & v0) => -1
# check: return -1.i8;
func public %or7(v0.i8, v1.i8) -> i8 {
func public %or7(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = and v1 v0;
v3.i8 = not v2;
Expand All @@ -73,7 +73,7 @@ func public %or7(v0.i8, v1.i8) -> i8 {

# (v0 ^ v1) | (v0 & !v1) => (v0 ^ v1)
# check: return v2;
func public %or8(v0.i8, v1.i8) -> i8 {
func public %or8(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = xor v0 v1;
v3.i8 = not v1;
Expand All @@ -84,7 +84,7 @@ func public %or8(v0.i8, v1.i8) -> i8 {

# (v0 ^ 1) | (!v1 & v0) => (v0 ^ v1)
# check: return v2;
func public %or9(v0.i8, v1.i8) -> i8 {
func public %or9(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = xor v0 v1;
v3.i8 = not v1;
Expand All @@ -95,7 +95,7 @@ func public %or9(v0.i8, v1.i8) -> i8 {

# (v0 ^ v1) | (!v0 & v1) => (v0 ^ v1)
# check: return v2;
func public %or10(v0.i8, v1.i8) -> i8 {
func public %or10(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = xor v0 v1;
v3.i8 = not v0;
Expand All @@ -106,7 +106,7 @@ func public %or10(v0.i8, v1.i8) -> i8 {

# (v0 ^ v1) | (v1 & !v0) => (v0 ^ v1)
# check: return v2;
func public %or11(v0.i8, v1.i8) -> i8 {
func public %or11(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = xor v0 v1;
v3.i8 = not v0;
Expand All @@ -117,7 +117,7 @@ func public %or11(v0.i8, v1.i8) -> i8 {

# (!v0 ^ v1) | (v0 & v1) => (!v0 ^ v1)
# check: return v3;
func public %or12(v0.i8, v1.i8) -> i8 {
func public %or12(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v0;
v3.i8 = xor v2 v1;
Expand All @@ -128,7 +128,7 @@ func public %or12(v0.i8, v1.i8) -> i8 {

# (!v0 ^ v1) | (v1 & v0) => (!v0 ^ v1)
# check: return v3;
func public %or13(v0.i8, v1.i8) -> i8 {
func public %or13(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v0;
v3.i8 = xor v2 v1;
Expand All @@ -139,7 +139,7 @@ func public %or13(v0.i8, v1.i8) -> i8 {

# (v0 ^ !v1) | (v0 & v1) => (v0 ^ !v1)
# check: return v3;
func public %or14(v0.i8, v1.i8) -> i8 {
func public %or14(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v1;
v3.i8 = xor v0 v2;
Expand All @@ -150,7 +150,7 @@ func public %or14(v0.i8, v1.i8) -> i8 {

# (v0 ^ !v1) | (v1 & v0) => (v0 ^ !v1)
# check: return v3;
func public %or15(v0.i8, v1.i8) -> i8 {
func public %or15(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v1;
v3.i8 = xor v0 v2;
Expand All @@ -161,7 +161,7 @@ func public %or15(v0.i8, v1.i8) -> i8 {

# (v0 | v1) | (v0 ^ v1) => (v0 | v1)
# check: return v2;
func public %or16(v0.i8, v1.i8) -> i8 {
func public %or16(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = or v0 v1;
v3.i8 = xor v0 v1;
Expand All @@ -171,7 +171,7 @@ func public %or16(v0.i8, v1.i8) -> i8 {

# (v0 | v1) | (v1 ^ v0) => (v0 | v1)
# check: return v2;
func public %or17(v0.i8, v1.i8) -> i8 {
func public %or17(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = or v0 v1;
v3.i8 = xor v1 v0;
Expand All @@ -181,7 +181,7 @@ func public %or17(v0.i8, v1.i8) -> i8 {

# (!v0 & v1) | !(v0 | v1) => !v0
# check: return v2;
func public %or18(v0.i8, v1.i8) -> i8 {
func public %or18(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v0;
v3.i8 = and v2 v1;
Expand All @@ -193,7 +193,7 @@ func public %or18(v0.i8, v1.i8) -> i8 {

# (!v0 & v1) | !(v1 | v0) => !v0
# check: return v2;
func public %or19(v0.i8, v1.i8) -> i8 {
func public %or19(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v0;
v3.i8 = and v2 v1;
Expand All @@ -205,7 +205,7 @@ func public %or19(v0.i8, v1.i8) -> i8 {

# (v0 & !v1) | !(v0 | v1) => !v1
# check: return v2;
func public %or20(v0.i8, v1.i8) -> i8 {
func public %or20(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v1;
v3.i8 = and v0 v2;
Expand All @@ -217,7 +217,7 @@ func public %or20(v0.i8, v1.i8) -> i8 {

# (v0 & !v1) | !(v1 | v0) => !v1
# check: return v2;
func public %or21(v0.i8, v1.i8) -> i8 {
func public %or21(v0.i8, v1.i8) -> i8 {
block0:
v2.i8 = not v1;
v3.i8 = and v0 v2;
Expand Down
2 changes: 1 addition & 1 deletion crates/filecheck/fixtures/licm/basic.sntn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ target = "evm-ethereum-london"
# nextln:
# nextln: block3:
# nextln: return;
func public %basic(v0.i32, v1.i32) -> void {
func public %basic(v0.i32, v1.i32) -> void {
block0:
jump block1;

Expand Down
2 changes: 0 additions & 2 deletions crates/ir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ dyn-clone = "1.0.4"
sonatina-triple = { path = "../triple", version = "0.0.3-alpha" }
indexmap = "2.0.0"
dot2 = { git = "https://github.com/sanpii/dot2.rs.git" }
bimap = "0.6.3"
smol_str = "0.2.2"
4 changes: 0 additions & 4 deletions crates/ir/src/builder/func_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,6 @@ where
self.module_builder.ctx.isa.type_provider().gas_type()
}

// fn cursor(&mut self) -> InsnInserter {
// InsnInserter::new(&mut self.func, self.loc)
// }

fn insert_insn(&mut self, insn_data: InsnData) -> Option<Value> {
let insn = self.cursor.insert_insn_data(&mut self.func, insn_data);
let result = self.cursor.make_result(&mut self.func, insn);
Expand Down
4 changes: 0 additions & 4 deletions crates/parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@ keywords = ["compiler", "evm", "wasm", "smart-contract"]
[dependencies]
ir = { package = "sonatina-ir", path = "../ir", version = "0.0.3-alpha" }
sonatina-triple = { path = "../triple", version = "0.0.3-alpha" }
smallvec = "1.7.0"
cranelift-entity = "0.104"
pest = "2.7.10"
pest_derive = "2.7.10"
pest-ast = "0.3.4"
from-pest = "0.3.2"
smol_str = "0.2.2"
hex = "0.4.3"
num-traits = { version = "0.2.19", default-features = false }
either = { version = "1.12.0", default-features = false }
annotate-snippets = "0.11.4"
rustc-hash = "2.0.0"
Expand Down

0 comments on commit f5d4b7c

Please sign in to comment.