PhaseIdealLoop::is_scaled_iv_plus_offset() returns false if 'exp' is an AddI node with the scaled iv as second input because is_scaled_iv() is only invoked for exp->in(1). We should fix it like this:
--- a/src/share/vm/opto/loopTransform.cpp Fri Dec 18 12:51:19 2015 +0100
+++ b/src/share/vm/opto/loopTransform.cpp Fri Dec 18 12:57:39 2015 +0100
@@ -1913,6 +1913,12 @@
}
return true;
}
+ if (is_scaled_iv(exp->in(2), iv, p_scale)) {
+ if (p_offset != NULL) {
+ *p_offset = exp->in(1);
+ }
+ return true;
+ }
if (exp->in(2)->is_Con()) {
Node* offset2 = NULL;
if (depth < 2 &&