comparison src/share/vm/opto/machnode.hpp @ 14498:04e7587c97dc

8032656: Tag the MachSpillCopies with purpose information Summary: Subclassed the MachSpillCopyNode with different subnodes for different spill purposes to enhance debugging / visualization Reviewed-by: kvn, roland
author adlertz
date Tue, 25 Feb 2014 14:09:02 +0100
parents 492e67693373
children 4ca6dc0799b6
comparison
equal deleted inserted replaced
14497:9a83b7b3e37c 14498:04e7587c97dc
518 518
519 //------------------------------MachSpillCopyNode------------------------------ 519 //------------------------------MachSpillCopyNode------------------------------
520 // Machine SpillCopy Node. Copies 1 or 2 words from any location to any 520 // Machine SpillCopy Node. Copies 1 or 2 words from any location to any
521 // location (stack or register). 521 // location (stack or register).
522 class MachSpillCopyNode : public MachIdealNode { 522 class MachSpillCopyNode : public MachIdealNode {
523 public:
524 enum SpillType {
525 TwoAddress, // Inserted when coalescing of a two-address-instruction node and its input fails
526 PhiInput, // Inserted when coalescing of a phi node and its input fails
527 DebugUse, // Inserted as debug info spills to safepoints in non-frequent blocks
528 LoopPhiInput, // Pre-split compares of loop-phis
529 Definition, // An lrg marked as spilled will be spilled to memory right after its definition,
530 // if in high pressure region or the lrg is bound
531 RegToReg, // A register to register move
532 RegToMem, // A register to memory move
533 MemToReg, // A memory to register move
534 PhiLocationDifferToInputLocation, // When coalescing phi nodes in PhaseChaitin::Split(), a move spill is inserted if
535 // the phi and its input resides at different locations (i.e. reg or mem)
536 BasePointerToMem, // Spill base pointer to memory at safepoint
537 InputToRematerialization, // When rematerializing a node we stretch the inputs live ranges, and they might be
538 // stretched beyond a new definition point, therefore we split out new copies instead
539 CallUse, // Spill use at a call
540 Bound // An lrg marked as spill that is bound and needs to be spilled at a use
541 };
542 private:
523 const RegMask *_in; // RegMask for input 543 const RegMask *_in; // RegMask for input
524 const RegMask *_out; // RegMask for output 544 const RegMask *_out; // RegMask for output
525 const Type *_type; 545 const Type *_type;
526 public: 546 const SpillType _spill_type;
527 MachSpillCopyNode( Node *n, const RegMask &in, const RegMask &out ) : 547 public:
528 MachIdealNode(), _in(&in), _out(&out), _type(n->bottom_type()) { 548 MachSpillCopyNode(SpillType spill_type, Node *n, const RegMask &in, const RegMask &out ) :
549 MachIdealNode(), _spill_type(spill_type), _in(&in), _out(&out), _type(n->bottom_type()) {
529 init_class_id(Class_MachSpillCopy); 550 init_class_id(Class_MachSpillCopy);
530 init_flags(Flag_is_Copy); 551 init_flags(Flag_is_Copy);
531 add_req(NULL); 552 add_req(NULL);
532 add_req(n); 553 add_req(n);
533 } 554 }
542 uint implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bool do_size, outputStream* st ) const; 563 uint implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bool do_size, outputStream* st ) const;
543 564
544 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; 565 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
545 virtual uint size(PhaseRegAlloc *ra_) const; 566 virtual uint size(PhaseRegAlloc *ra_) const;
546 567
547 #ifndef PRODUCT 568
548 virtual const char *Name() const { return "MachSpillCopy"; } 569 #ifndef PRODUCT
570 virtual const char *Name() const {
571 switch (_spill_type) {
572 case TwoAddress:
573 return "TwoAddressSpillCopy";
574 case PhiInput:
575 return "PhiInputSpillCopy";
576 case DebugUse:
577 return "DebugUseSpillCopy";
578 case LoopPhiInput:
579 return "LoopPhiInputSpillCopy";
580 case Definition:
581 return "DefinitionSpillCopy";
582 case RegToReg:
583 return "RegToRegSpillCopy";
584 case RegToMem:
585 return "RegToMemSpillCopy";
586 case MemToReg:
587 return "MemToRegSpillCopy";
588 case PhiLocationDifferToInputLocation:
589 return "PhiLocationDifferToInputLocationSpillCopy";
590 case BasePointerToMem:
591 return "BasePointerToMemSpillCopy";
592 case InputToRematerialization:
593 return "InputToRematerializationSpillCopy";
594 case CallUse:
595 return "CallUseSpillCopy";
596 case Bound:
597 return "BoundSpillCopy";
598 default:
599 assert(false, "Must have valid spill type");
600 return "MachSpillCopy";
601 }
602 }
603
549 virtual void format( PhaseRegAlloc *, outputStream *st ) const; 604 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
550 #endif 605 #endif
551 }; 606 };
552 607
553 //------------------------------MachBranchNode-------------------------------- 608 //------------------------------MachBranchNode--------------------------------