364 int count) { |
364 int count) { |
365 Node* mem = phase->C->top(); |
365 Node* mem = phase->C->top(); |
366 if (!forward_ctl->is_top()) { |
366 if (!forward_ctl->is_top()) { |
367 // copy forward |
367 // copy forward |
368 mem = start_mem_dest; |
368 mem = start_mem_dest; |
|
369 uint alias_idx_src = phase->C->get_alias_index(atp_src); |
|
370 uint alias_idx_dest = phase->C->get_alias_index(atp_dest); |
|
371 bool same_alias = (alias_idx_src == alias_idx_dest); |
369 |
372 |
370 if (count > 0) { |
373 if (count > 0) { |
371 Node* v = LoadNode::make(*phase, forward_ctl, start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered); |
374 Node* v = LoadNode::make(*phase, forward_ctl, start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered); |
372 v = phase->transform(v); |
375 v = phase->transform(v); |
373 mem = StoreNode::make(*phase, forward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered); |
376 mem = StoreNode::make(*phase, forward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered); |
374 mem = phase->transform(mem); |
377 mem = phase->transform(mem); |
375 for (int i = 1; i < count; i++) { |
378 for (int i = 1; i < count; i++) { |
376 Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); |
379 Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); |
377 Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); |
380 Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); |
378 Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); |
381 Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); |
379 v = LoadNode::make(*phase, forward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered); |
382 v = LoadNode::make(*phase, forward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered); |
380 v = phase->transform(v); |
383 v = phase->transform(v); |
381 mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); |
384 mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); |
382 mem = phase->transform(mem); |
385 mem = phase->transform(mem); |
383 } |
386 } |
384 } else if(can_reshape) { |
387 } else if(can_reshape) { |
406 int count) { |
409 int count) { |
407 Node* mem = phase->C->top(); |
410 Node* mem = phase->C->top(); |
408 if (!backward_ctl->is_top()) { |
411 if (!backward_ctl->is_top()) { |
409 // copy backward |
412 // copy backward |
410 mem = start_mem_dest; |
413 mem = start_mem_dest; |
|
414 uint alias_idx_src = phase->C->get_alias_index(atp_src); |
|
415 uint alias_idx_dest = phase->C->get_alias_index(atp_dest); |
|
416 bool same_alias = (alias_idx_src == alias_idx_dest); |
411 |
417 |
412 if (count > 0) { |
418 if (count > 0) { |
413 for (int i = count-1; i >= 1; i--) { |
419 for (int i = count-1; i >= 1; i--) { |
414 Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); |
420 Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); |
415 Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); |
421 Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); |
416 Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); |
422 Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); |
417 Node* v = LoadNode::make(*phase, backward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered); |
423 Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered); |
418 v = phase->transform(v); |
424 v = phase->transform(v); |
419 mem = StoreNode::make(*phase, backward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); |
425 mem = StoreNode::make(*phase, backward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); |
420 mem = phase->transform(mem); |
426 mem = phase->transform(mem); |
421 } |
427 } |
422 Node* v = LoadNode::make(*phase, backward_ctl, mem, adr_src, atp_src, value_type, copy_type, MemNode::unordered); |
428 Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered); |
423 v = phase->transform(v); |
429 v = phase->transform(v); |
424 mem = StoreNode::make(*phase, backward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered); |
430 mem = StoreNode::make(*phase, backward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered); |
425 mem = phase->transform(mem); |
431 mem = phase->transform(mem); |
426 } else if(can_reshape) { |
432 } else if(can_reshape) { |
427 PhaseIterGVN* igvn = phase->is_IterGVN(); |
433 PhaseIterGVN* igvn = phase->is_IterGVN(); |