Compiler constant handling rework
In preparation for de-optimization, reworked the constant
handling mechanism. Also took advantage of knowledge of
constant operands (particularly for long operations).
Significant performance improvements for Mandelbrot
(~60 seconds to ~34 seconds). Minor improvements in other
benchmarks.
The new constant handling breaks two of the existing
optimization passes: "Skip Large Method" and "Load/Store
Elimization."
I don't intend to update the large method optimization
because it will be superceeded by the upcoming interpreter/
fingerprinting mechanism. Leaving the code in place for
now in order to compare compile-time improvements with
fingerprinting/interpret. All related code will be deleted
when that is complete.
The load/store elimination pass needs some rework to handle
uses of multiple-register loads and stores. It will be
updated & restored in a future CL.
Change-Id: Ia979abaf51b8ae81bbb0428031cbcea854625fac
diff --git a/src/compiler/codegen/mir_to_gbc.cc b/src/compiler/codegen/mir_to_gbc.cc
index f67f760..ba90269 100644
--- a/src/compiler/codegen/mir_to_gbc.cc
+++ b/src/compiler/codegen/mir_to_gbc.cc
@@ -1018,7 +1018,7 @@
}
EmitPopShadowFrame(cu);
cu->irb->CreateRet(GetLLVMValue(cu, rl_src[0].orig_sreg));
- bb->has_return = true;
+ DCHECK(bb->has_return);
}
break;
@@ -1028,7 +1028,7 @@
}
EmitPopShadowFrame(cu);
cu->irb->CreateRetVoid();
- bb->has_return = true;
+ DCHECK(bb->has_return);
}
break;
@@ -2572,8 +2572,7 @@
RegLocation rl_dest = GetLoc(cu, call_inst);
RegLocation rl_result = EvalLoc(cu, rl_dest, kAnyReg, true);
if (rl_dest.wide) {
- cg->LoadConstantValueWide(cu, rl_result.low_reg, rl_result.high_reg,
- (immval) & 0xffffffff, (immval >> 32) & 0xffffffff);
+ cg->LoadConstantWide(cu, rl_result.low_reg, rl_result.high_reg, immval);
cg->StoreValueWide(cu, rl_dest, rl_result);
} else {
int immediate = immval & 0xffffffff;