Skip to content

Commit 7637c24

Browse files
Some fixes
1 parent 2a5e33a commit 7637c24

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/passes/DeadStoreElimination.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ struct MemoryLogic : public ComparingLogic {
495495
// behavior - they trap on unaligned addresses. For simplicity, only
496496
// consider the case where atomicity is identical.
497497
// TODO: use ignoreImplicitTraps
498-
if (store->isAtomic != load->isAtomic) {
498+
if (store->isAtomic() != load->isAtomic()) {
499499
return false;
500500
}
501501

@@ -516,7 +516,7 @@ struct MemoryLogic : public ComparingLogic {
516516
auto* store = store_->cast<Store>();
517517

518518
// As in isLoadFrom, atomic stores are dangerous.
519-
if (store->isAtomic != otherStore->isAtomic) {
519+
if (store->isAtomic() != otherStore->isAtomic()) {
520520
return false;
521521
}
522522

@@ -655,7 +655,9 @@ struct LocalDeadStoreElimination
655655
: public WalkerPass<PostWalker<LocalDeadStoreElimination>> {
656656
bool isFunctionParallel() { return true; }
657657

658-
Pass* create() { return new LocalDeadStoreElimination; }
658+
std::unique_ptr<Pass> create() override {
659+
return std::make_unique<LocalDeadStoreElimination>();
660+
}
659661

660662
void doWalkFunction(Function* func) {
661663
// Optimize globals.

test/lit/help/wasm-metadce.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@
227227
;; CHECK-NEXT:
228228
;; CHECK-NEXT: --intrinsic-lowering lower away binaryen intrinsics
229229
;; CHECK-NEXT:
230+
;; CHECK-NEXT: --ldse removes dead stores (only
231+
;; CHECK-NEXT: looking at local info)
232+
;; CHECK-NEXT:
230233
;; CHECK-NEXT: --legalize-and-prune-js-interface legalizes the import/export
231234
;; CHECK-NEXT: boundary and prunes when needed
232235
;; CHECK-NEXT:

test/lit/help/wasm-opt.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@
259259
;; CHECK-NEXT:
260260
;; CHECK-NEXT: --intrinsic-lowering lower away binaryen intrinsics
261261
;; CHECK-NEXT:
262+
;; CHECK-NEXT: --ldse removes dead stores (only
263+
;; CHECK-NEXT: looking at local info)
264+
;; CHECK-NEXT:
262265
;; CHECK-NEXT: --legalize-and-prune-js-interface legalizes the import/export
263266
;; CHECK-NEXT: boundary and prunes when needed
264267
;; CHECK-NEXT:

test/lit/help/wasm2js.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@
191191
;; CHECK-NEXT:
192192
;; CHECK-NEXT: --intrinsic-lowering lower away binaryen intrinsics
193193
;; CHECK-NEXT:
194+
;; CHECK-NEXT: --ldse removes dead stores (only
195+
;; CHECK-NEXT: looking at local info)
196+
;; CHECK-NEXT:
194197
;; CHECK-NEXT: --legalize-and-prune-js-interface legalizes the import/export
195198
;; CHECK-NEXT: boundary and prunes when needed
196199
;; CHECK-NEXT:

0 commit comments

Comments
 (0)