Add missing calls to `RecordSimplification()`.
Note that not all transformations in the instruction simplifier call
this helper. It is used to track a loosely defined category of
transformations for which we may benefit from re-running the
simplifier.
Change-Id: I14dd841a30c526065cff337627c9156abe3d7c0a
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index fd79901..a31d378 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -250,6 +250,7 @@
// src
instruction->ReplaceWith(input_other);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
}
}
}
@@ -278,6 +279,7 @@
if (!shl->GetRight()->HasUses()) {
shl->GetRight()->GetBlock()->RemoveInstruction(shl->GetRight());
}
+ RecordSimplification();
return true;
}
@@ -907,6 +909,7 @@
if (Primitive::IsIntegralType(instruction->GetType())) {
instruction->ReplaceWith(input_other);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}
}
@@ -999,6 +1002,7 @@
// src
instruction->ReplaceWith(instruction->GetLeft());
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}
@@ -1116,6 +1120,7 @@
// src
instruction->ReplaceWith(input_other);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}
@@ -1176,6 +1181,7 @@
// src
instruction->ReplaceWith(input_other);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}
@@ -1216,6 +1222,7 @@
// 0
instruction->ReplaceWith(input_cst);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
} else if (IsPowerOfTwo(factor)) {
// Replace code looking like
// MUL dst, src, pow_of_2
@@ -1334,6 +1341,7 @@
// src
instruction->ReplaceWith(input_other);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}
@@ -1347,6 +1355,7 @@
// src
instruction->ReplaceWith(instruction->GetLeft());
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}
@@ -1382,6 +1391,7 @@
// yields `-0.0`.
instruction->ReplaceWith(input_other);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}
@@ -1460,6 +1470,7 @@
// src
instruction->ReplaceWith(input_other);
instruction->GetBlock()->RemoveInstruction(instruction);
+ RecordSimplification();
return;
}