src/hotspot/share/adlc/formssel.cpp
changeset 51078 fc6cfe40e32a
parent 50525 767cdb97f103
child 51566 904cf5407ac7
equal deleted inserted replaced
51077:9baa91bc7567 51078:fc6cfe40e32a
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  3632         && form2_inst
  3632         && form2_inst
  3633         && data_type != Form::none
  3633         && data_type != Form::none
  3634         && (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory)
  3634         && (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory)
  3635         && (name_left != NULL)       // NOT (load)
  3635         && (name_left != NULL)       // NOT (load)
  3636         && (name_right == NULL) ) {  // NOT (load memory foo)
  3636         && (name_right == NULL) ) {  // NOT (load memory foo)
  3637       const Form *form2_left = name_left ? globals[name_left] : NULL;
  3637       const Form *form2_left = globals[name_left];
  3638       if( form2_left && form2_left->is_cisc_mem(globals) ) {
  3638       if( form2_left && form2_left->is_cisc_mem(globals) ) {
  3639         cisc_spillable = Is_cisc_spillable;
  3639         cisc_spillable = Is_cisc_spillable;
  3640         operand        = _name;
  3640         operand        = _name;
  3641         reg_type       = _result;
  3641         reg_type       = _result;
  3642         return Is_cisc_spillable;
  3642         return Is_cisc_spillable;
  3643       } else {
  3643       } else {
  3644         cisc_spillable = Not_cisc_spillable;
  3644         cisc_spillable = Not_cisc_spillable;
  3645       }
  3645       }
  3646     }
  3646     }
  3647     // Detect reg vs memory
  3647     // Detect reg vs memory
  3648     else if( form->is_cisc_reg(globals) && form2->is_cisc_mem(globals) ) {
  3648     else if (form->is_cisc_reg(globals) && form2 != NULL && form2->is_cisc_mem(globals)) {
  3649       cisc_spillable = Is_cisc_spillable;
  3649       cisc_spillable = Is_cisc_spillable;
  3650       operand        = _name;
  3650       operand        = _name;
  3651       reg_type       = _result;
  3651       reg_type       = _result;
  3652       return Is_cisc_spillable;
  3652       return Is_cisc_spillable;
  3653     } else {
  3653     } else {
  3708       left_spillable = Not_cisc_spillable;
  3708       left_spillable = Not_cisc_spillable;
  3709     }
  3709     }
  3710   }
  3710   }
  3711 
  3711 
  3712   // Check right operands: recursive walk to identify reg->mem operand
  3712   // Check right operands: recursive walk to identify reg->mem operand
  3713   if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) {
  3713   if (_rChild == NULL) {
  3714     right_spillable =  Maybe_cisc_spillable;
  3714     if (mRule2->_rChild == NULL) {
       
  3715       right_spillable =  Maybe_cisc_spillable;
       
  3716     } else {
       
  3717       assert(0, "_rChild should not be NULL");
       
  3718     }
  3715   } else {
  3719   } else {
  3716     right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
  3720     right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
  3717   }
  3721   }
  3718 
  3722 
  3719   // Combine results of left and right checks
  3723   // Combine results of left and right checks