Revert "Optimize easy multiply and easy div remainder."
This reverts commit 08df4b3da75366e5db37e696eaa7e855cba01deb.
diff --git a/compiler/dex/quick/gen_common.cc b/compiler/dex/quick/gen_common.cc
index b23e10f..2afa5ca 100644
--- a/compiler/dex/quick/gen_common.cc
+++ b/compiler/dex/quick/gen_common.cc
@@ -1626,31 +1626,14 @@
// Returns true if it added instructions to 'cu' to multiply 'rl_src' by 'lit'
// and store the result in 'rl_dest'.
bool Mir2Lir::HandleEasyMultiply(RegLocation rl_src, RegLocation rl_dest, int lit) {
- if (lit < 0) {
- return false;
- }
- if (lit == 0) {
- RegLocation rl_result = EvalLoc(rl_dest, kCoreReg, true);
- LoadConstant(rl_result.reg, 0);
- StoreValue(rl_dest, rl_result);
- return true;
- }
- if (lit == 1) {
- rl_src = LoadValue(rl_src, kCoreReg);
- RegLocation rl_result = EvalLoc(rl_dest, kCoreReg, true);
- OpRegCopy(rl_result.reg, rl_src.reg);
- StoreValue(rl_dest, rl_result);
- return true;
- }
- // There is RegRegRegShift on Arm, so check for more special cases
- if (cu_->instruction_set == kThumb2) {
- return EasyMultiply(rl_src, rl_dest, lit);
- }
// Can we simplify this multiplication?
bool power_of_two = false;
bool pop_count_le2 = false;
bool power_of_two_minus_one = false;
- if (IsPowerOfTwo(lit)) {
+ if (lit < 2) {
+ // Avoid special cases.
+ return false;
+ } else if (IsPowerOfTwo(lit)) {
power_of_two = true;
} else if (IsPopCountLE2(lit)) {
pop_count_le2 = true;