diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-11-08 14:24:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-08 14:24:28 -0800 |
commit | 0014c71b0607bf3e335ba32ec3a893aec741ae7d (patch) | |
tree | 75eb9e43a54fccf5073b56a3c8b704237302a4c1 /src/dataflow | |
parent | ba1cf64bc926c7fd9e5b679d69800a47a9b0210b (diff) | |
download | binaryen-0014c71b0607bf3e335ba32ec3a893aec741ae7d.tar.gz binaryen-0014c71b0607bf3e335ba32ec3a893aec741ae7d.tar.bz2 binaryen-0014c71b0607bf3e335ba32ec3a893aec741ae7d.zip |
fix flipping in dataflow graph generation (#1732)
For souper we need to flip some operations in DataFlow IR, since souper doesn't have any redundant ones. But we flipped not just left and right but also equal/not equal, which was wrong.
Diffstat (limited to 'src/dataflow')
-rw-r--r-- | src/dataflow/graph.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dataflow/graph.h b/src/dataflow/graph.h index 57c03bb2e..7f5654f8d 100644 --- a/src/dataflow/graph.h +++ b/src/dataflow/graph.h @@ -518,14 +518,14 @@ struct Graph : public UnifiedExpressionVisitor<Graph, Node*> { Builder builder(*module); BinaryOp opposite; switch (curr->op) { - case GtSInt32: opposite = LeSInt32; break; - case GtSInt64: opposite = LeSInt64; break; - case GeSInt32: opposite = LtSInt32; break; - case GeSInt64: opposite = LtSInt64; break; - case GtUInt32: opposite = LeUInt32; break; - case GtUInt64: opposite = LeUInt64; break; - case GeUInt32: opposite = LtUInt32; break; - case GeUInt64: opposite = LtUInt64; break; + case GtSInt32: opposite = LtSInt32; break; + case GtSInt64: opposite = LtSInt64; break; + case GeSInt32: opposite = LeSInt32; break; + case GeSInt64: opposite = LeSInt64; break; + case GtUInt32: opposite = LtUInt32; break; + case GtUInt64: opposite = LtUInt64; break; + case GeUInt32: opposite = LeUInt32; break; + case GeUInt64: opposite = LeUInt64; break; default: WASM_UNREACHABLE(); } auto* ret = visitBinary(builder.makeBinary(opposite, curr->right, curr->left)); |