Lines Matching refs:phase

111 Node *CMoveNode::Ideal(PhaseGVN *phase, bool can_reshape) {
112 if( in(0) && remove_dead_region(phase, can_reshape) ) return this;
115 assert( !phase->eqv(in(Condition), this) &&
116 !phase->eqv(in(IfFalse), this) &&
117 !phase->eqv(in(IfTrue), this), "dead loop in CMoveNode::Ideal" );
118 if( phase->type(in(Condition)) == Type::TOP )
124 BoolNode* b2 = b->negate(phase);
125 return make( phase->C, in(Control), phase->transform(b2), in(IfTrue), in(IfFalse), _type );
133 Node *CMoveNode::is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b ) {
135 if( (phase->eqv(cmp->in(1),f) &&
136 phase->eqv(cmp->in(2),t)) ||
138 (phase->eqv(cmp->in(2),f) &&
139 phase->eqv(cmp->in(1),t)) ) {
158 Node *CMoveNode::Identity( PhaseTransform *phase ) {
159 if( phase->eqv(in(IfFalse),in(IfTrue)) ) // C-moving identical inputs?
161 if( phase->type(in(Condition)) == TypeInt::ZERO )
163 if( phase->type(in(Condition)) == TypeInt::ONE )
176 Node *id = is_cmove_id( phase, cmp, in(IfTrue), in(IfFalse), b );
186 const Type *CMoveNode::Value( PhaseTransform *phase ) const {
187 if( phase->type(in(Condition)) == Type::TOP )
189 return phase->type(in(IfFalse))->meet(phase->type(in(IfTrue)));
214 Node *CMoveINode::Ideal(PhaseGVN *phase, bool can_reshape) {
216 Node *x = CMoveNode::Ideal(phase, can_reshape);
229 if( phase->type(in(IfFalse)) == TypeInt::ZERO && !(phase->type(in(IfTrue)) == TypeInt::ZERO) ) {
232 BoolNode* b2 = b->negate(phase);
233 return make( phase->C, in(Control), phase->transform(b2), in(IfTrue), in(IfFalse), _type );
241 if( phase->type(in(IfFalse)) == TypeInt::ZERO && phase->type(in(IfTrue)) == TypeInt::ONE ) {
243 } else if( phase->type(in(IfFalse)) == TypeInt::ONE && phase->type(in(IfTrue)) == TypeInt::ZERO ) {
257 if( phase->type(cmp->in(2)) == TypeInt::ZERO ) {
258 } else if( phase->type(cmp->in(2)) == TypeInt::ONE ) {
260 if( phase->type(cmp->in(1)) != TypeInt::BOOL )
270 Node *n = new (phase->C) Conv2BNode( cmp->in(1) );
272 n = new (phase->C) XorINode( phase->transform(n), phase->intcon(1) );
281 Node *CMoveFNode::Ideal(PhaseGVN *phase, bool can_reshape) {
283 Node *x = CMoveNode::Ideal(phase, can_reshape);
306 if( phase->type(cmpf->in(cmp_zero_idx)) == TypeF::ZERO ) {
308 } else if (phase->type(cmpf->in(3 - cmp_zero_idx)) == TypeF::ZERO) {
324 phase->type(sub->in(1)) != TypeF::ZERO ) return NULL;
326 Node *abs = new (phase->C) AbsFNode( X );
328 abs = new (phase->C) SubFNode(sub->in(1), phase->transform(abs));
337 Node *CMoveDNode::Ideal(PhaseGVN *phase, bool can_reshape) {
339 Node *x = CMoveNode::Ideal(phase, can_reshape);
362 if( phase->type(cmpd->in(cmp_zero_idx)) == TypeD::ZERO ) {
364 } else if (phase->type(cmpd->in(3 - cmp_zero_idx)) == TypeD::ZERO) {
380 phase->type(sub->in(1)) != TypeD::ZERO ) return NULL;
382 Node *abs = new (phase->C) AbsDNode( X );
384 abs = new (phase->C) SubDNode(sub->in(1), phase->transform(abs));
392 Node *ConstraintCastNode::Identity( PhaseTransform *phase ) {
393 return phase->type(in(1))->higher_equal(_type) ? in(1) : this;
398 const Type *ConstraintCastNode::Value( PhaseTransform *phase ) const {
399 if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
400 const Type* ft = phase->type(in(1))->filter(_type);
408 const Type* t1 = phase->type(in(1));
415 if (phase->type(in(1)) == TypePtr::NULL_PTR &&
428 Node *ConstraintCastNode::Ideal(PhaseGVN *phase, bool can_reshape){
429 return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL;
460 Node *CheckCastPPNode::Identity( PhaseTransform *phase ) {
463 return (phase->type(in(1)) == phase->type(this)) ? in(1) : this;
471 static bool can_cause_alias(Node *n, PhaseTransform *phase) {
475 possible_alias = !n->as_Store()->value_never_loaded(phase);
491 const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const {
492 if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP;
494 const Type *inn = phase->type(in(1));
568 Node *CheckCastPPNode::Ideal(PhaseGVN *phase, bool can_reshape){
569 return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL;
573 Node* DecodeNNode::Identity(PhaseTransform* phase) {
574 const Type *t = phase->type( in(1) );
584 const Type *DecodeNNode::Value( PhaseTransform *phase ) const {
585 const Type *t = phase->type( in(1) );
593 Node* EncodePNode::Identity(PhaseTransform* phase) {
594 const Type *t = phase->type( in(1) );
604 const Type *EncodePNode::Value( PhaseTransform *phase ) const {
605 const Type *t = phase->type( in(1) );
620 Node *Conv2BNode::Identity( PhaseTransform *phase ) {
621 const Type *t = phase->type( in(1) );
630 const Type *Conv2BNode::Value( PhaseTransform *phase ) const {
631 const Type *t = phase->type( in(1) );
652 const Type *ConvD2FNode::Value( PhaseTransform *phase ) const {
653 const Type *t = phase->type( in(1) );
663 Node *ConvD2FNode::Identity(PhaseTransform *phase) {
669 const Type *ConvD2INode::Value( PhaseTransform *phase ) const {
670 const Type *t = phase->type( in(1) );
679 Node *ConvD2INode::Ideal(PhaseGVN *phase, bool can_reshape) {
688 Node *ConvD2INode::Identity(PhaseTransform *phase) {
694 const Type *ConvD2LNode::Value( PhaseTransform *phase ) const {
695 const Type *t = phase->type( in(1) );
703 Node *ConvD2LNode::Identity(PhaseTransform *phase) {
713 Node *ConvD2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
721 const Type *ConvF2DNode::Value( PhaseTransform *phase ) const {
722 const Type *t = phase->type( in(1) );
731 const Type *ConvF2INode::Value( PhaseTransform *phase ) const {
732 const Type *t = phase->type( in(1) );
740 Node *ConvF2INode::Identity(PhaseTransform *phase) {
750 Node *ConvF2INode::Ideal(PhaseGVN *phase, bool can_reshape) {
758 const Type *ConvF2LNode::Value( PhaseTransform *phase ) const {
759 const Type *t = phase->type( in(1) );
767 Node *ConvF2LNode::Identity(PhaseTransform *phase) {
777 Node *ConvF2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
785 const Type *ConvI2DNode::Value( PhaseTransform *phase ) const {
786 const Type *t = phase->type( in(1) );
795 const Type *ConvI2FNode::Value( PhaseTransform *phase ) const {
796 const Type *t = phase->type( in(1) );
804 Node *ConvI2FNode::Identity(PhaseTransform *phase) {
814 const Type *ConvI2LNode::Value( PhaseTransform *phase ) const {
815 const Type *t = phase->type( in(1) );
833 Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
841 if (can_reshape && !phase->C->major_progress()) {
842 const TypeInt* in_type = phase->type(in(1))->isa_int();
909 if (phase->type(x) == Type::TOP) return this_changed;
910 if (phase->type(y) == Type::TOP) return this_changed;
911 const TypeInt* tx = phase->type(x)->is_int();
912 const TypeInt* ty = phase->type(y)->is_int();
963 Node* cx = phase->transform( new (phase->C) ConvI2LNode(x, TypeLong::make(rxlo, rxhi, widen)) );
964 Node* cy = phase->transform( new (phase->C) ConvI2LNode(y, TypeLong::make(rylo, ryhi, widen)) );
966 case Op_AddI: return new (phase->C) AddLNode(cx, cy);
967 case Op_SubI: return new (phase->C) SubLNode(cx, cy);
978 const Type *ConvL2DNode::Value( PhaseTransform *phase ) const {
979 const Type *t = phase->type( in(1) );
988 const Type *ConvL2FNode::Value( PhaseTransform *phase ) const {
989 const Type *t = phase->type( in(1) );
998 Node *ConvL2INode::Identity( PhaseTransform *phase ) {
1005 const Type *ConvL2INode::Value( PhaseTransform *phase ) const {
1006 const Type *t = phase->type( in(1) );
1018 Node *ConvL2INode::Ideal(PhaseGVN *phase, bool can_reshape) {
1023 if( phase->type(andl->in(2)) == TypeLong::make( 0xFFFFFFFF ) ) {
1039 if (phase->type(x) == Type::TOP) return NULL;
1040 if (phase->type(y) == Type::TOP) return NULL;
1041 Node *add1 = phase->transform(new (phase->C) ConvL2INode(x));
1042 Node *add2 = phase->transform(new (phase->C) ConvL2INode(y));
1043 return new (phase->C) AddINode(add1,add2);
1054 const Type *CastX2PNode::Value( PhaseTransform *phase ) const {
1055 const Type* t = phase->type(in(1));
1075 static inline Node* addP_of_X2P(PhaseGVN *phase,
1080 dispX = new (phase->C) SubXNode(phase->MakeConX(0), phase->transform(dispX));
1082 return new (phase->C) AddPNode(phase->C->top(),
1083 phase->transform(new (phase->C) CastX2PNode(base)),
1084 phase->transform(dispX));
1087 Node *CastX2PNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1096 if (phase->find_intptr_t_con(x, -1) == 0)
1099 if (fits_in_int(phase->type(y), true)) {
1100 return addP_of_X2P(phase, x, y, true);
1106 if (fits_in_int(phase->type(y))) {
1107 return addP_of_X2P(phase, x, y);
1109 if (fits_in_int(phase->type(x))) {
1110 return addP_of_X2P(phase, y, x);
1118 Node *CastX2PNode::Identity( PhaseTransform *phase ) {
1125 const Type *CastP2XNode::Value( PhaseTransform *phase ) const {
1126 const Type* t = phase->type(in(1));
1135 Node *CastP2XNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1136 return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL;
1140 Node *CastP2XNode::Identity( PhaseTransform *phase ) {
1149 Node *RoundFloatNode::Identity( PhaseTransform *phase ) {
1152 if (phase->type(in(1))->base() == Type::FloatCon) return in(1);
1163 const Type *RoundFloatNode::Value( PhaseTransform *phase ) const {
1164 return phase->type( in(1) );
1170 Node *RoundDoubleNode::Identity( PhaseTransform *phase ) {
1173 if (phase->type(in(1))->base() == Type::DoubleCon) return in(1);
1186 const Type *RoundDoubleNode::Value( PhaseTransform *phase ) const {
1187 return phase->type( in(1) );
1203 // phase-ordering problem with stripping Opaque1 in IGVN followed by some
1205 Node *Opaque1Node::Identity( PhaseTransform *phase ) {
1206 return phase->C->major_progress() ? this : in(1);
1227 const Type *MoveL2DNode::Value( PhaseTransform *phase ) const {
1228 const Type *t = phase->type( in(1) );
1238 const Type *MoveI2FNode::Value( PhaseTransform *phase ) const {
1239 const Type *t = phase->type( in(1) );
1249 const Type *MoveF2INode::Value( PhaseTransform *phase ) const {
1250 const Type *t = phase->type( in(1) );
1260 const Type *MoveD2LNode::Value( PhaseTransform *phase ) const {
1261 const Type *t = phase->type( in(1) );
1271 const Type* CountLeadingZerosINode::Value(PhaseTransform* phase) const {
1272 const Type* t = phase->type(in(1));
1293 const Type* CountLeadingZerosLNode::Value(PhaseTransform* phase) const {
1294 const Type* t = phase->type(in(1));
1316 const Type* CountTrailingZerosINode::Value(PhaseTransform* phase) const {
1317 const Type* t = phase->type(in(1));
1338 const Type* CountTrailingZerosLNode::Value(PhaseTransform* phase) const {
1339 const Type* t = phase->type(in(1));