diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/ExpressionAnalyzer.cpp | 5 | ||||
-rw-r--r-- | src/ir/ExpressionManipulator.cpp | 4 | ||||
-rw-r--r-- | src/ir/ReFinalize.cpp | 1 | ||||
-rw-r--r-- | src/ir/effects.h | 6 | ||||
-rw-r--r-- | src/ir/utils.h | 2 |
5 files changed, 18 insertions, 0 deletions
diff --git a/src/ir/ExpressionAnalyzer.cpp b/src/ir/ExpressionAnalyzer.cpp index ee3cb0123..f7b7b636e 100644 --- a/src/ir/ExpressionAnalyzer.cpp +++ b/src/ir/ExpressionAnalyzer.cpp @@ -196,6 +196,11 @@ template<typename T> void visitImmediates(Expression* curr, T& visitor) { } void visitSIMDTernary(SIMDTernary* curr) { visitor.visitInt(curr->op); } void visitSIMDShift(SIMDShift* curr) { visitor.visitInt(curr->op); } + void visitSIMDLoad(SIMDLoad* curr) { + visitor.visitInt(curr->op); + visitor.visitAddress(curr->offset); + visitor.visitAddress(curr->align); + } void visitMemoryInit(MemoryInit* curr) { visitor.visitIndex(curr->segment); } diff --git a/src/ir/ExpressionManipulator.cpp b/src/ir/ExpressionManipulator.cpp index 7c4de4ceb..fdefbb2e0 100644 --- a/src/ir/ExpressionManipulator.cpp +++ b/src/ir/ExpressionManipulator.cpp @@ -179,6 +179,10 @@ flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) { return builder.makeSIMDShift( curr->op, copy(curr->vec), copy(curr->shift)); } + Expression* visitSIMDLoad(SIMDLoad* curr) { + return builder.makeSIMDLoad( + curr->op, curr->offset, curr->align, copy(curr->ptr)); + } Expression* visitConst(Const* curr) { return builder.makeConst(curr->value); } diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp index 6c4e7a447..b27b49bd4 100644 --- a/src/ir/ReFinalize.cpp +++ b/src/ir/ReFinalize.cpp @@ -147,6 +147,7 @@ void ReFinalize::visitSIMDReplace(SIMDReplace* curr) { curr->finalize(); } void ReFinalize::visitSIMDShuffle(SIMDShuffle* curr) { curr->finalize(); } void ReFinalize::visitSIMDTernary(SIMDTernary* curr) { curr->finalize(); } void ReFinalize::visitSIMDShift(SIMDShift* curr) { curr->finalize(); } +void ReFinalize::visitSIMDLoad(SIMDLoad* curr) { curr->finalize(); } void ReFinalize::visitMemoryInit(MemoryInit* curr) { curr->finalize(); } void ReFinalize::visitDataDrop(DataDrop* curr) { curr->finalize(); } void ReFinalize::visitMemoryCopy(MemoryCopy* curr) { curr->finalize(); } diff --git a/src/ir/effects.h b/src/ir/effects.h index dcee4404b..e93c63017 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -307,6 +307,12 @@ struct EffectAnalyzer void visitSIMDShuffle(SIMDShuffle* curr) {} void visitSIMDTernary(SIMDTernary* curr) {} void visitSIMDShift(SIMDShift* curr) {} + void visitSIMDLoad(SIMDLoad* curr) { + readsMemory = true; + if (!ignoreImplicitTraps) { + implicitTrap = true; + } + } void visitMemoryInit(MemoryInit* curr) { writesMemory = true; if (!ignoreImplicitTraps) { diff --git a/src/ir/utils.h b/src/ir/utils.h index 4ca80caa3..ca8803741 100644 --- a/src/ir/utils.h +++ b/src/ir/utils.h @@ -134,6 +134,7 @@ struct ReFinalize void visitSIMDShuffle(SIMDShuffle* curr); void visitSIMDTernary(SIMDTernary* curr); void visitSIMDShift(SIMDShift* curr); + void visitSIMDLoad(SIMDLoad* curr); void visitMemoryInit(MemoryInit* curr); void visitDataDrop(DataDrop* curr); void visitMemoryCopy(MemoryCopy* curr); @@ -198,6 +199,7 @@ struct ReFinalizeNode : public OverriddenVisitor<ReFinalizeNode> { void visitSIMDShuffle(SIMDShuffle* curr) { curr->finalize(); } void visitSIMDTernary(SIMDTernary* curr) { curr->finalize(); } void visitSIMDShift(SIMDShift* curr) { curr->finalize(); } + void visitSIMDLoad(SIMDLoad* curr) { curr->finalize(); } void visitMemoryInit(MemoryInit* curr) { curr->finalize(); } void visitDataDrop(DataDrop* curr) { curr->finalize(); } void visitMemoryCopy(MemoryCopy* curr) { curr->finalize(); } |