Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Unified Diff: src/compiler/machine-operator-reducer.cc

Issue 2662233002: [wasm] Remove x / -1 = -x constant folding for wasm (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/machine-operator-reducer.cc
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc
index b3dcd2f507123e5392c67079d6276a5059e1528e..3eb8a7bd49b49a14060d519bfd400f3c76492744 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -437,7 +437,7 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
if (m.IsFoldable()) { // K / K => K
return ReplaceFloat64(m.left().Value() / m.right().Value());
}
- if (m.right().Is(-1)) { // x / -1.0 => -x
+ if (!wasm_origin_ && m.right().Is(-1)) { // x / -1.0 => -x
titzer 2017/01/31 17:24:49 Can we rename this option to something closer to w
ahaas 2017/01/31 19:43:37 Done with the rebasing.
node->RemoveInput(1);
NodeProperties::ChangeOp(node, machine()->Float64Neg());
return Changed(node);
« no previous file with comments | « no previous file | test/mjsunit/wasm/float-constant-folding.js » ('j') | test/mjsunit/wasm/float-constant-folding.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698