8160748: Inconsistent types for ideal_reg

Mon, 18 Jun 2018 14:39:46 -0700

author
kevinw
date
Mon, 18 Jun 2018 14:39:46 -0700
changeset 9333
2fccf735a116
parent 9332
ae93017b2930
child 9334
95b3ba140211

8160748: Inconsistent types for ideal_reg
Summary: Made ideal_reg consistently uint.
Reviewed-by: kvn, iveresov

src/cpu/ppc/vm/ppc.ad file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/sparc.ad file | annotate | diff | comparison | revisions
src/cpu/x86/vm/x86.ad file | annotate | diff | comparison | revisions
src/share/vm/adlc/output_c.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/chaitin.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/matcher.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/matcher.hpp file | annotate | diff | comparison | revisions
src/share/vm/opto/reg_split.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/type.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/type.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/ppc/vm/ppc.ad	Fri Jun 15 15:37:35 2018 +0000
     1.2 +++ b/src/cpu/ppc/vm/ppc.ad	Mon Jun 18 14:39:46 2018 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  //
     1.5 -// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
     1.6 +// Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     1.7  // Copyright (c) 2012, 2017 SAP SE. All rights reserved.
     1.8  // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.9  //
    1.10 @@ -2174,12 +2174,12 @@
    1.11  }
    1.12  
    1.13  // Vector ideal reg.
    1.14 -const int Matcher::vector_ideal_reg(int size) {
    1.15 +const uint Matcher::vector_ideal_reg(int size) {
    1.16    assert(MaxVectorSize == 8 && size == 8, "");
    1.17    return Op_RegL;
    1.18  }
    1.19  
    1.20 -const int Matcher::vector_shift_count_ideal_reg(int size) {
    1.21 +const uint Matcher::vector_shift_count_ideal_reg(int size) {
    1.22    fatal("vector shift is not supported");
    1.23    return Node::NotAMachineReg;
    1.24  }
     2.1 --- a/src/cpu/sparc/vm/sparc.ad	Fri Jun 15 15:37:35 2018 +0000
     2.2 +++ b/src/cpu/sparc/vm/sparc.ad	Mon Jun 18 14:39:46 2018 -0700
     2.3 @@ -1,5 +1,5 @@
     2.4  //
     2.5 -// Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     2.6 +// Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     2.7  // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8  //
     2.9  // This code is free software; you can redistribute it and/or modify it
    2.10 @@ -1877,12 +1877,12 @@
    2.11  }
    2.12  
    2.13  // Vector ideal reg
    2.14 -const int Matcher::vector_ideal_reg(int size) {
    2.15 +const uint Matcher::vector_ideal_reg(int size) {
    2.16    assert(MaxVectorSize == 8, "");
    2.17    return Op_RegD;
    2.18  }
    2.19  
    2.20 -const int Matcher::vector_shift_count_ideal_reg(int size) {
    2.21 +const uint Matcher::vector_shift_count_ideal_reg(int size) {
    2.22    fatal("vector shift is not supported");
    2.23    return Node::NotAMachineReg;
    2.24  }
     3.1 --- a/src/cpu/x86/vm/x86.ad	Fri Jun 15 15:37:35 2018 +0000
     3.2 +++ b/src/cpu/x86/vm/x86.ad	Mon Jun 18 14:39:46 2018 -0700
     3.3 @@ -1,5 +1,5 @@
     3.4  //
     3.5 -// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
     3.6 +// Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     3.7  // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8  //
     3.9  // This code is free software; you can redistribute it and/or modify it
    3.10 @@ -683,7 +683,7 @@
    3.11  }
    3.12  
    3.13  // Vector ideal reg corresponding to specidied size in bytes
    3.14 -const int Matcher::vector_ideal_reg(int size) {
    3.15 +const uint Matcher::vector_ideal_reg(int size) {
    3.16    assert(MaxVectorSize >= size, "");
    3.17    switch(size) {
    3.18      case  4: return Op_VecS;
    3.19 @@ -696,7 +696,7 @@
    3.20  }
    3.21  
    3.22  // Only lowest bits of xmm reg are used for vector shift count.
    3.23 -const int Matcher::vector_shift_count_ideal_reg(int size) {
    3.24 +const uint Matcher::vector_shift_count_ideal_reg(int size) {
    3.25    return Op_VecS;
    3.26  }
    3.27  
     4.1 --- a/src/share/vm/adlc/output_c.cpp	Fri Jun 15 15:37:35 2018 +0000
     4.2 +++ b/src/share/vm/adlc/output_c.cpp	Mon Jun 18 14:39:46 2018 -0700
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -4177,11 +4177,11 @@
    4.11    fprintf(fp_cpp,"%s\n", _frame->_c_calling_convention);
    4.12    fprintf(fp_cpp,"}\n\n");
    4.13    // Java Return Value Location
    4.14 -  fprintf(fp_cpp,"OptoRegPair Matcher::return_value(int ideal_reg, bool is_outgoing) {\n");
    4.15 +  fprintf(fp_cpp,"OptoRegPair Matcher::return_value(uint ideal_reg, bool is_outgoing) {\n");
    4.16    fprintf(fp_cpp,"%s\n", _frame->_return_value);
    4.17    fprintf(fp_cpp,"}\n\n");
    4.18    // Native Return Value Location
    4.19 -  fprintf(fp_cpp,"OptoRegPair Matcher::c_return_value(int ideal_reg, bool is_outgoing) {\n");
    4.20 +  fprintf(fp_cpp,"OptoRegPair Matcher::c_return_value(uint ideal_reg, bool is_outgoing) {\n");
    4.21    fprintf(fp_cpp,"%s\n", _frame->_c_return_value);
    4.22    fprintf(fp_cpp,"}\n\n");
    4.23  
     5.1 --- a/src/share/vm/opto/chaitin.cpp	Fri Jun 15 15:37:35 2018 +0000
     5.2 +++ b/src/share/vm/opto/chaitin.cpp	Mon Jun 18 14:39:46 2018 -0700
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -755,7 +755,7 @@
    5.11          const RegMask &rm = n->out_RegMask();
    5.12          lrg.AND( rm );
    5.13  
    5.14 -        int ireg = n->ideal_reg();
    5.15 +        uint ireg = n->ideal_reg();
    5.16          assert( !n->bottom_type()->isa_oop_ptr() || ireg == Op_RegP,
    5.17                  "oops must be in Op_RegP's" );
    5.18  
    5.19 @@ -961,7 +961,7 @@
    5.20  
    5.21          // Check for bound register masks
    5.22          const RegMask &lrgmask = lrg.mask();
    5.23 -        int kreg = n->in(k)->ideal_reg();
    5.24 +        uint kreg = n->in(k)->ideal_reg();
    5.25          bool is_vect = RegMask::is_vector(kreg);
    5.26          assert(n->in(k)->bottom_type()->isa_vect() == NULL ||
    5.27                 is_vect || kreg == Op_RegD || kreg == Op_RegL,
     6.1 --- a/src/share/vm/opto/matcher.cpp	Fri Jun 15 15:37:35 2018 +0000
     6.2 +++ b/src/share/vm/opto/matcher.cpp	Mon Jun 18 14:39:46 2018 -0700
     6.3 @@ -1,5 +1,5 @@
     6.4  /*
     6.5 - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     6.6 + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     6.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8   *
     6.9   * This code is free software; you can redistribute it and/or modify it
    6.10 @@ -193,7 +193,7 @@
    6.11    const TypeTuple *range = C->tf()->range();
    6.12    if( range->cnt() > TypeFunc::Parms ) { // If not a void function
    6.13      // Get ideal-register return type
    6.14 -    int ireg = range->field_at(TypeFunc::Parms)->ideal_reg();
    6.15 +    uint ireg = range->field_at(TypeFunc::Parms)->ideal_reg();
    6.16      // Get machine return register
    6.17      uint sop = C->start()->Opcode();
    6.18      OptoRegPair regs = return_value(ireg, false);
     7.1 --- a/src/share/vm/opto/matcher.hpp	Fri Jun 15 15:37:35 2018 +0000
     7.2 +++ b/src/share/vm/opto/matcher.hpp	Mon Jun 18 14:39:46 2018 -0700
     7.3 @@ -1,5 +1,5 @@
     7.4  /*
     7.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     7.6 + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     7.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.8   *
     7.9   * This code is free software; you can redistribute it and/or modify it
    7.10 @@ -283,8 +283,8 @@
    7.11    }
    7.12  
    7.13    // Vector ideal reg
    7.14 -  static const int vector_ideal_reg(int len);
    7.15 -  static const int vector_shift_count_ideal_reg(int len);
    7.16 +  static const uint vector_ideal_reg(int len);
    7.17 +  static const uint vector_shift_count_ideal_reg(int len);
    7.18  
    7.19    // CPU supports misaligned vectors store/load.
    7.20    static const bool misaligned_vectors_ok();
    7.21 @@ -326,8 +326,8 @@
    7.22    virtual OptoReg::Name return_addr() const;
    7.23    RegMask              _return_addr_mask;
    7.24    // Return value register.  On Intel it is EAX.  On Sparc i0/o0.
    7.25 -  static OptoRegPair   return_value(int ideal_reg, bool is_outgoing);
    7.26 -  static OptoRegPair c_return_value(int ideal_reg, bool is_outgoing);
    7.27 +  static OptoRegPair   return_value(uint ideal_reg, bool is_outgoing);
    7.28 +  static OptoRegPair c_return_value(uint ideal_reg, bool is_outgoing);
    7.29    RegMask                     _return_value_mask;
    7.30    // Inline Cache Register
    7.31    static OptoReg::Name  inline_cache_reg();
     8.1 --- a/src/share/vm/opto/reg_split.cpp	Fri Jun 15 15:37:35 2018 +0000
     8.2 +++ b/src/share/vm/opto/reg_split.cpp	Mon Jun 18 14:39:46 2018 -0700
     8.3 @@ -1,5 +1,5 @@
     8.4  /*
     8.5 - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     8.6 + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
     8.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8   *
     8.9   * This code is free software; you can redistribute it and/or modify it
    8.10 @@ -59,7 +59,7 @@
    8.11    // If ideal reg doesn't exist we've got a bad schedule happening
    8.12    // that is forcing us to spill something that isn't spillable.
    8.13    // Bail rather than abort
    8.14 -  int ireg = def->ideal_reg();
    8.15 +  uint ireg = def->ideal_reg();
    8.16    if( ireg == 0 || ireg == Op_RegFlags ) {
    8.17      assert(false, "attempted to spill a non-spillable item");
    8.18      C->record_method_not_compilable("attempted to spill a non-spillable item");
    8.19 @@ -1163,7 +1163,7 @@
    8.20          // Grab UP info for DEF
    8.21          const RegMask &dmask = n->out_RegMask();
    8.22          bool defup = dmask.is_UP();
    8.23 -        int ireg = n->ideal_reg();
    8.24 +        uint ireg = n->ideal_reg();
    8.25          bool is_vect = RegMask::is_vector(ireg);
    8.26          // Only split at Def if this is a HRP block or bound (and spilled once)
    8.27          if( !n->rematerialize() &&
     9.1 --- a/src/share/vm/opto/type.cpp	Fri Jun 15 15:37:35 2018 +0000
     9.2 +++ b/src/share/vm/opto/type.cpp	Mon Jun 18 14:39:46 2018 -0700
     9.3 @@ -1,5 +1,5 @@
     9.4  /*
     9.5 - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     9.6 + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     9.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9.8   *
     9.9   * This code is free software; you can redistribute it and/or modify it
    9.10 @@ -51,7 +51,7 @@
    9.11  Dict* Type::_shared_type_dict = NULL;
    9.12  
    9.13  // Array which maps compiler types to Basic Types
    9.14 -Type::TypeInfo Type::_type_info[Type::lastype] = {
    9.15 +const Type::TypeInfo Type::_type_info[Type::lastype] = {
    9.16    { Bad,             T_ILLEGAL,    "bad",           false, Node::NotAMachineReg, relocInfo::none          },  // Bad
    9.17    { Control,         T_ILLEGAL,    "control",       false, 0,                    relocInfo::none          },  // Control
    9.18    { Bottom,          T_VOID,       "top",           false, 0,                    relocInfo::none          },  // Top
    10.1 --- a/src/share/vm/opto/type.hpp	Fri Jun 15 15:37:35 2018 +0000
    10.2 +++ b/src/share/vm/opto/type.hpp	Mon Jun 18 14:39:46 2018 -0700
    10.3 @@ -1,5 +1,5 @@
    10.4  /*
    10.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    10.6 + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
    10.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    10.8   *
    10.9   * This code is free software; you can redistribute it and/or modify it
   10.10 @@ -130,17 +130,17 @@
   10.11  
   10.12  private:
   10.13    typedef struct {
   10.14 -    const TYPES                dual_type;
   10.15 -    const BasicType            basic_type;
   10.16 -    const char*                msg;
   10.17 -    const bool                 isa_oop;
   10.18 -    const int                  ideal_reg;
   10.19 -    const relocInfo::relocType reloc;
   10.20 +    TYPES                dual_type;
   10.21 +    BasicType            basic_type;
   10.22 +    const char*          msg;
   10.23 +    bool                 isa_oop;
   10.24 +    uint                 ideal_reg;
   10.25 +    relocInfo::relocType reloc;
   10.26    } TypeInfo;
   10.27  
   10.28    // Dictionary of types shared among compilations.
   10.29    static Dict* _shared_type_dict;
   10.30 -  static TypeInfo _type_info[];
   10.31 +  static const TypeInfo _type_info[];
   10.32  
   10.33    static int uhash( const Type *const t );
   10.34    // Structural equality check.  Assumes that cmp() has already compared
   10.35 @@ -407,7 +407,7 @@
   10.36  
   10.37    // Mapping from compiler type to VM BasicType
   10.38    BasicType basic_type() const       { return _type_info[_base].basic_type; }
   10.39 -  int ideal_reg() const              { return _type_info[_base].ideal_reg; }
   10.40 +  uint ideal_reg() const             { return _type_info[_base].ideal_reg; }
   10.41    const char* msg() const            { return _type_info[_base].msg; }
   10.42    bool isa_oop_ptr() const           { return _type_info[_base].isa_oop; }
   10.43    relocInfo::relocType reloc() const { return _type_info[_base].reloc; }

mercurial