< prev index next >
src/share/vm/c1/c1_Canonicalizer.cpp
Print this page
*** 948,957 ****
--- 948,968 ----
int log2_scale;
if (match(x, &base, &index, &log2_scale)) {
x->set_base(base);
x->set_index(index);
+ if (index != NULL) {
+ // If index is pinned, do not scale again
+ if (index->is_pinned()) {
+ log2_scale = 0;
+ } else {
+ // If there is a scale, pin the index so it won't be scaled again
+ if (log2_scale != 0) {
+ index->pin();
+ }
+ }
+ }
x->set_log2_scale(log2_scale);
if (PrintUnsafeOptimization) {
tty->print_cr("Canonicalizer: UnsafeRawOp id %d: base = id %d, index = id %d, log2_scale = %d",
x->id(), x->base()->id(), x->index()->id(), x->log2_scale());
}
< prev index next >