Lines Matching refs:phase

49 Node *SubNode::Identity( PhaseTransform *phase ) {
55 if( phase->type( in(1) )->higher_equal( zero ) &&
57 phase->type( in(2)->in(1) )->higher_equal( zero ) ) {
63 if( phase->eqv(in(1)->in(2),in(2)) )
65 if (phase->eqv(in(1)->in(1),in(2)))
74 phase->eqv(in(1)->in(2)->in(1),in(2)) )
78 return ( phase->type( in(2) )->higher_equal( zero ) ) ? in(1) : this;
83 const Type *SubNode::Value( PhaseTransform *phase ) const {
87 const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1);
89 const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2);
131 Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){
139 if( phase->eqv( in1, this ) || phase->eqv( in2, this ) ||
141 ( phase->eqv( in1->in(1), this ) || phase->eqv( in1->in(2), this ) ||
142 phase->eqv( in1->in(1), in1 ) || phase->eqv( in1->in(2), in1 ) ) )
146 const Type *t2 = phase->type( in2 );
152 return new (phase->C) AddINode(in1, phase->intcon(-i->get_con()));
159 const Type *tadd = phase->type( in1->in(2) );
161 Node *sub2 = phase->transform( new (phase->C) SubINode( in1->in(1), in2 ));
162 return new (phase->C) AddINode( sub2, in1->in(2) );
172 const TypeInt* tcon = phase->type(in22)->isa_int();
174 Node* sub2 = phase->transform( new (phase->C) SubINode(in1, in21) );
175 Node* neg_c0 = phase->intcon(- tcon->get_con());
176 return new (phase->C) AddINode(sub2, neg_c0);
180 const Type *t1 = phase->type( in1 );
186 ( phase->eqv( in2->in(1), this ) || phase->eqv( in2->in(2), this ) ||
187 phase->eqv( in2->in(1), in2 ) || phase->eqv( in2->in(2), in2 ) ) )
193 phase->eqv( in1, in2->in(1) ) )
194 return new (phase->C) SubINode( phase->intcon(0),in2->in(2));
197 phase->eqv( in1->in(1), in2 ) )
198 return new (phase->C) SubINode( phase->intcon(0),in1->in(2));
201 phase->eqv( in1, in2->in(2) ) )
202 return new (phase->C) SubINode( phase->intcon(0),in2->in(1));
206 return new (phase->C) SubINode( in2->in(2), in2->in(1) );
212 return new (phase->C) SubINode( phase->intcon(-con), in2->in(1) );
216 return new (phase->C) SubINode( in1->in(2), in2->in(2) );
220 return new (phase->C) SubINode( in1->in(1), in2->in(1) );
224 return new (phase->C) SubINode( in1->in(1), in2->in(2) );
228 return new (phase->C) SubINode( in1->in(2), in2->in(1) );
233 Node *add1 = phase->transform( new (phase->C) AddINode( in1, in2->in(2) ) );
234 return new (phase->C) SubINode( add1, in2->in(1) );
261 Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
269 if( phase->eqv( in1, this ) || phase->eqv( in2, this ) ||
271 ( phase->eqv( in1->in(1), this ) || phase->eqv( in1->in(2), this ) ||
272 phase->eqv( in1->in(1), in1 ) || phase->eqv( in1->in(2), in1 ) ) )
276 if( phase->type( in2 ) == Type::TOP ) return NULL;
277 const TypeLong *i = phase->type( in2 )->isa_long();
281 return new (phase->C) AddLNode(in1, phase->longcon(-i->get_con()));
288 const Type *tadd = phase->type( in1->in(2) );
290 Node *sub2 = phase->transform( new (phase->C) SubLNode( in11, in2 ));
291 return new (phase->C) AddLNode( sub2, in1->in(2) );
300 const TypeLong* tcon = phase->type(in22)->isa_long();
302 Node* sub2 = phase->transform( new (phase->C) SubLNode(in1, in21) );
303 Node* neg_c0 = phase->longcon(- tcon->get_con());
304 return new (phase->C) AddLNode(sub2, neg_c0);
308 const Type *t1 = phase->type( in1 );
314 ( phase->eqv( in2->in(1), this ) || phase->eqv( in2->in(2), this ) ||
315 phase->eqv( in2->in(1), in2 ) || phase->eqv( in2->in(2), in2 ) ) )
321 phase->eqv( in1, in2->in(1) ) )
322 return new (phase->C) SubLNode( phase->makecon(TypeLong::ZERO), in2->in(2));
325 phase->eqv( in1, in2->in(2) ) )
326 return new (phase->C) SubLNode( phase->makecon(TypeLong::ZERO),in2->in(1));
329 if( phase->type( in1 ) == TypeLong::ZERO && op2 == Op_SubL )
330 return new (phase->C) SubLNode( in2->in(2), in2->in(1) );
334 return new (phase->C) SubLNode( in1->in(2), in2->in(2) );
338 return new (phase->C) SubLNode( in1->in(1), in2->in(1) );
342 Node *add1 = phase->transform( new (phase->C) AddLNode( in1, in2->in(2) ) );
343 return new (phase->C) SubLNode( add1, in2->in(1) );
371 const Type *SubFPNode::Value( PhaseTransform *phase ) const {
375 const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1);
377 const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2);
383 if( phase->eqv(in1, in2) ) return add_id();
398 Node *SubFNode::Ideal(PhaseGVN *phase, bool can_reshape) {
399 const Type *t2 = phase->type( in(2) );
402 // return new (phase->C, 3) AddFNode(in(1), phase->makecon( TypeF::make(-t2->getf()) ) );
406 if( IdealizedNumerics && !phase->C->method()->is_strict() ) {
409 phase->eqv(in(1),in(2)->in(1) ) )
410 return new (phase->C) SubFNode( phase->makecon(TypeF::ZERO),in(2)->in(2));
415 //if( phase->type(in(1)) == TypeF::ZERO )
416 //return new (phase->C, 2) NegFNode(in(2));
441 Node *SubDNode::Ideal(PhaseGVN *phase, bool can_reshape){
442 const Type *t2 = phase->type( in(2) );
445 // return new (phase->C, 3) AddDNode(in(1), phase->makecon( TypeD::make(-t2->getd()) ) );
449 if( IdealizedNumerics && !phase->C->method()->is_strict() ) {
452 phase->eqv(in(1),in(2)->in(1) ) )
453 return new (phase->C) SubDNode( phase->makecon(TypeD::ZERO),in(2)->in(2));
458 //if( phase->type(in(1)) == TypeD::ZERO )
459 //return new (phase->C, 2) NegDNode(in(2));
487 Node *CmpNode::Identity( PhaseTransform *phase ) {
580 Node *CmpINode::Ideal( PhaseGVN *phase, bool can_reshape ) {
581 if (phase->type(in(2))->higher_equal(TypeInt::ZERO)) {
584 return new (phase->C) CmpLNode(in(1)->in(1),in(1)->in(2));
586 return new (phase->C) CmpFNode(in(1)->in(1),in(1)->in(2));
588 return new (phase->C) CmpDNode(in(1)->in(1),in(1)->in(2));
707 static inline Node* isa_java_mirror_load(PhaseGVN* phase, Node* n) {
713 const TypeInstPtr* tp = phase->type(n)->isa_instptr();
714 if (!tp || tp->klass() != phase->C->env()->Class_klass()) return NULL;
718 Node* k = AddPNode::Ideal_base_and_offset(adr, phase, off);
720 const TypeKlassPtr* tkp = phase->type(k)->isa_klassptr();
727 static inline Node* isa_const_java_mirror(PhaseGVN* phase, Node* n) {
732 const TypeInstPtr* tp = phase->type(n)->isa_instptr();
743 return phase->makecon(TypePtr::NULL_PTR);
748 return phase->makecon(TypeKlassPtr::make(mirror_type->as_klass()));
758 Node *CmpPNode::Ideal( PhaseGVN *phase, bool can_reshape ) {
772 Node* k1 = isa_java_mirror_load(phase, in(1));
773 Node* k2 = isa_java_mirror_load(phase, in(2));
774 Node* conk2 = isa_const_java_mirror(phase, in(2));
786 const TypeKlassPtr* t2 = phase->type(in(2))->isa_klassptr();
803 Node* ldk2 = AddPNode::Ideal_base_and_offset(adr1, phase, con2);
812 this->set_req(2, phase->makecon(TypePtr::NULL_PTR));
849 phase->C->dependencies()->assert_leaf_type(ik);
936 Node *CmpNNode::Ideal( PhaseGVN *phase, bool can_reshape ) {
944 const Type *CmpFNode::Value( PhaseTransform *phase ) const {
948 const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1);
950 const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2);
974 const Type *CmpDNode::Value( PhaseTransform *phase ) const {
978 const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1);
980 const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2);
1000 Node *CmpDNode::Ideal(PhaseGVN *phase, bool can_reshape){
1024 Node *new_in2 = phase->makecon( TypeF::make(t2_value_as_float) );
1031 ? new (phase->C) CmpF3Node( new_in1, new_in2 )
1032 : new (phase->C) CmpFNode ( new_in1, new_in2 ) ;
1097 Node* BoolNode::make_predicate(Node* test_value, PhaseGVN* phase) {
1100 Compile* C = phase->C;
1104 const Type* ftype = phase->type(test_value->in(CMoveNode::IfFalse));
1105 const Type* ttype = phase->type(test_value->in(CMoveNode::IfTrue));
1109 return phase->transform( bol->negate(phase) );
1114 Node* cmp = new (C) CmpINode(test_value, phase->intcon(0));
1115 cmp = phase->transform(cmp);
1117 return phase->transform(bol);
1121 Node* BoolNode::as_int_value(PhaseGVN* phase) {
1123 Node* cmov = CMoveNode::make(phase->C, NULL, this,
1124 phase->intcon(0), phase->intcon(1),
1126 return phase->transform(cmov);
1130 BoolNode* BoolNode::negate(PhaseGVN* phase) {
1131 Compile* C = phase->C;
1137 Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1165 cmp = phase->transform( cmp );
1166 return new (phase->C) BoolNode( cmp, _test.commute() );
1173 const TypeInt* cmp2_type = phase->type(cmp2)->isa_int();
1179 phase->type( j_xor->in(1) ) == TypeInt::BOOL &&
1180 phase->type( j_xor->in(2) ) == TypeInt::ONE &&
1183 Node *ncmp = phase->transform(new (phase->C) CmpINode(j_xor->in(1),cmp2));
1184 return new (phase->C) BoolNode( ncmp, _test.negate() );
1194 Node *ncmp = phase->transform(phase->type(c2b->in(1))->isa_int()
1195 ? (Node*)new (phase->C) CmpINode(c2b->in(1),cmp2)
1196 : (Node*)new (phase->C) CmpPNode(c2b->in(1),phase->makecon(TypePtr::NULL_PTR))
1198 return new (phase->C) BoolNode( ncmp, _test._test );
1208 Node *ncmp = phase->transform( new (phase->C) CmpINode(cmp1->in(1),cmp1->in(2)));
1209 return new (phase->C) BoolNode( ncmp, _test._test );
1218 phase->type( cmp1->in(1) ) == TypeInt::ZERO &&
1219 phase->type( cmp1->in(2) )->higher_equal(TypeInt::SYMINT) ) {
1220 Node *ncmp = phase->transform( new (phase->C) CmpINode(cmp1->in(2),cmp2));
1221 return new (phase->C) BoolNode( ncmp, _test.commute() );
1245 // if( !phase->allow_progress() ) return NULL;
1255 // phase->type( cmp1->in(2) ) == TypeInt::ONE )
1256 // return clone_cmp( cmp, cmp1->in(1), cmp2, phase, BoolTest::lt );
1258 // phase->type( cmp2->in(2) ) == TypeInt::MINUS_1 )
1259 // return clone_cmp( cmp, cmp1, cmp2->in(1), phase, BoolTest::lt );
1262 // phase->type( cmp1->in(2) ) == TypeInt::MINUS_1 )
1263 // return clone_cmp( cmp, cmp1->in(1), cmp2, phase, BoolTest::le );
1265 // phase->type( cmp2->in(2) ) == TypeInt::ONE )
1266 // return clone_cmp( cmp, cmp1, cmp2->in(1), phase, BoolTest::le );
1275 const Type *BoolNode::Value( PhaseTransform *phase ) const {
1276 return _test.cc2logical( phase->type( in(1) ) );
1304 const Type *SqrtDNode::Value( PhaseTransform *phase ) const {
1305 const Type *t1 = phase->type( in(1) );
1316 const Type *CosDNode::Value( PhaseTransform *phase ) const {
1317 const Type *t1 = phase->type( in(1) );
1327 const Type *SinDNode::Value( PhaseTransform *phase ) const {
1328 const Type *t1 = phase->type( in(1) );
1338 const Type *TanDNode::Value( PhaseTransform *phase ) const {
1339 const Type *t1 = phase->type( in(1) );
1349 const Type *LogDNode::Value( PhaseTransform *phase ) const {
1350 const Type *t1 = phase->type( in(1) );
1360 const Type *Log10DNode::Value( PhaseTransform *phase ) const {
1361 const Type *t1 = phase->type( in(1) );
1371 const Type *ExpDNode::Value( PhaseTransform *phase ) const {
1372 const Type *t1 = phase->type( in(1) );
1383 const Type *PowDNode::Value( PhaseTransform *phase ) const {
1384 const Type *t1 = phase->type( in(1) );
1387 const Type *t2 = phase->type( in(2) );