Skip to content

Commit

Permalink
Skip reorder-locals in merge-similar-functions because it's already done
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Mar 2, 2022
1 parent 05637e9 commit ab6dc26
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
8 changes: 0 additions & 8 deletions src/passes/MergeSimilarFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,6 @@ struct MergeSimilarFunctions : public Pass {
bool invalidatesDWARF() override { return true; }

void run(PassRunner* runner, Module* module) override {
{
// Canonicalize locals indices to make comparison easier.
PassRunner runner(module);
runner.setIsNested(true);
runner.add("reorder-locals");
runner.run();
}

std::vector<EquivalentClass> classes;
collectEquivalentClasses(classes, module);
std::sort(
Expand Down
54 changes: 0 additions & 54 deletions test/lit/passes/merge-similar-functions.wast
Original file line number Diff line number Diff line change
Expand Up @@ -116,60 +116,6 @@
;; CHECK-NEXT: )
)

;; allowing locals indexes order difference by reorder-locals
(module
;; CHECK: (func $use-locals-0-1 (result i32)
;; CHECK-NEXT: (call $byn$mgfn-shared$use-locals-0-1
;; CHECK-NEXT: (i32.const 42)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $use-locals-0-1 (result i32)
(local $0 i32)
(local $1 i32)
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(drop (local.get $0))
(i32.add (local.get $1) (i32.const 42))
)
;; CHECK: (func $use-locals-1-0 (result i32)
;; CHECK-NEXT: (call $byn$mgfn-shared$use-locals-0-1
;; CHECK-NEXT: (i32.const 43)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $use-locals-1-0 (result i32)
(local $0 i32)
(local $1 i32)
(nop) (nop) (nop) (nop) (nop) (nop)
(nop) (nop) (nop) (nop) (nop) (nop)
(drop (local.get $1))
(i32.add (local.get $0) (i32.const 43))
)

;; CHECK: (func $byn$mgfn-shared$use-locals-0-1 (param $0 i32) (result i32)
;; CHECK-NEXT: (local $1 i32)
;; CHECK-NEXT: (local $2 i32)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
)

;; different callees
(module
;; CHECK: (func $callee-0 (result i32)
Expand Down

0 comments on commit ab6dc26

Please sign in to comment.