(root)/
gcc-13.2.0/
gcc/
tree-ssanames.h
       1  /* SSA name expresssons routines
       2     Copyright (C) 2013-2023 Free Software Foundation, Inc.
       3  
       4  This file is part of GCC.
       5  
       6  GCC is free software; you can redistribute it and/or modify it under
       7  the terms of the GNU General Public License as published by the Free
       8  Software Foundation; either version 3, or (at your option) any later
       9  version.
      10  
      11  GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      12  WARRANTY; without even the implied warranty of MERCHANTABILITY or
      13  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      14   for more details.
      15  
      16  You should have received a copy of the GNU General Public License
      17  along with GCC; see the file COPYING3.  If not see
      18  <http://www.gnu.org/licenses/>.  */
      19  
      20  #ifndef GCC_TREE_SSANAMES_H
      21  #define GCC_TREE_SSANAMES_H
      22  
      23  /* Aliasing information for SSA_NAMEs representing pointer variables.  */
      24  
      25  struct GTY(()) ptr_info_def
      26  {
      27    /* The points-to solution.  */
      28    struct pt_solution pt;
      29  
      30    /* Alignment and misalignment of the pointer in bytes.  Together
      31       align and misalign specify low known bits of the pointer.
      32       ptr & (align - 1) == misalign.  */
      33  
      34    /* When known, this is the power-of-two byte alignment of the object this
      35       pointer points into.  This is usually DECL_ALIGN_UNIT for decls and
      36       MALLOC_ABI_ALIGNMENT for allocated storage.  When the alignment is not
      37       known, it is zero.  Do not access directly but use functions
      38       get_ptr_info_alignment, set_ptr_info_alignment,
      39       mark_ptr_info_alignment_unknown and similar.  */
      40    unsigned int align;
      41  
      42    /* When alignment is known, the byte offset this pointer differs from the
      43       above alignment.  Access only through the same helper functions as align
      44       above.  */
      45    unsigned int misalign;
      46  };
      47  
      48  
      49  #define SSANAMES(fun) (fun)->gimple_df->ssa_names
      50  #define DEFAULT_DEFS(fun) (fun)->gimple_df->default_defs
      51  
      52  #define num_ssa_names (vec_safe_length (cfun->gimple_df->ssa_names))
      53  #define ssa_name(i) ((*cfun->gimple_df->ssa_names)[(i)])
      54  
      55  #define FOR_EACH_SSA_NAME(I, VAR, FN)					\
      56    for (I = 1; SSANAMES (FN)->iterate (I, &VAR); ++I)			\
      57      if (VAR)
      58  
      59  /* Sets the value range to SSA.  */
      60  extern bool set_range_info (tree, const vrange &);
      61  extern void set_nonzero_bits (tree, const wide_int_ref &);
      62  extern wide_int get_nonzero_bits (const_tree);
      63  extern bool ssa_name_has_boolean_range (tree);
      64  extern void init_ssanames (struct function *, int);
      65  extern void fini_ssanames (struct function *);
      66  extern void ssanames_print_statistics (void);
      67  extern tree make_ssa_name_fn (struct function *, tree, gimple *,
      68  			      unsigned int version = 0);
      69  extern void init_ssa_name_imm_use (tree);
      70  extern void release_ssa_name_fn (struct function *, tree);
      71  extern bool get_ptr_info_alignment (struct ptr_info_def *, unsigned int *,
      72  				    unsigned int *);
      73  extern void mark_ptr_info_alignment_unknown (struct ptr_info_def *);
      74  extern void set_ptr_info_alignment (struct ptr_info_def *, unsigned int,
      75  				    unsigned int);
      76  extern void adjust_ptr_info_misalignment (struct ptr_info_def *, poly_uint64);
      77  extern struct ptr_info_def *get_ptr_info (tree);
      78  extern void set_ptr_nonnull (tree);
      79  
      80  extern tree copy_ssa_name_fn (struct function *, tree, gimple *);
      81  extern void duplicate_ssa_name_ptr_info (tree, struct ptr_info_def *);
      82  extern tree duplicate_ssa_name_fn (struct function *, tree, gimple *);
      83  extern void duplicate_ssa_name_range_info (tree dest, tree src);
      84  extern void reset_flow_sensitive_info (tree);
      85  extern void reset_flow_sensitive_info_in_bb (basic_block);
      86  extern void release_defs (gimple *);
      87  extern void replace_ssa_name_symbol (tree, tree);
      88  extern void flush_ssaname_freelist (void);
      89  
      90  
      91  /* Return an SSA_NAME node for variable VAR defined in statement STMT
      92     in function cfun.  */
      93  
      94  inline tree
      95  make_ssa_name (tree var, gimple *stmt = NULL)
      96  {
      97    return make_ssa_name_fn (cfun, var, stmt);
      98  }
      99  
     100  /* Return an SSA_NAME node using the template SSA name NAME defined in
     101     statement STMT in function cfun.  */
     102  
     103  inline tree
     104  copy_ssa_name (tree var, gimple *stmt = NULL)
     105  {
     106    return copy_ssa_name_fn (cfun, var, stmt);
     107  }
     108  
     109  /*  Creates a duplicate of a SSA name NAME tobe defined by statement STMT
     110      in function cfun.  */
     111  
     112  inline tree
     113  duplicate_ssa_name (tree var, gimple *stmt)
     114  {
     115    return duplicate_ssa_name_fn (cfun, var, stmt);
     116  }
     117  
     118  /* Release the SSA name NAME used in function cfun.  */
     119  
     120  inline void
     121  release_ssa_name (tree name)
     122  {
     123    release_ssa_name_fn (cfun, name);
     124  }
     125  
     126  /* Return an anonymous SSA_NAME node for type TYPE defined in statement STMT
     127     in function cfun.  Arrange so that it uses NAME in dumps.  */
     128  
     129  inline tree
     130  make_temp_ssa_name (tree type, gimple *stmt, const char *name)
     131  {
     132    tree ssa_name;
     133    gcc_checking_assert (TYPE_P (type));
     134    ssa_name = make_ssa_name_fn (cfun, type, stmt);
     135    SET_SSA_NAME_VAR_OR_IDENTIFIER (ssa_name, get_identifier (name));
     136    return ssa_name;
     137  }
     138  
     139  
     140  #endif /* GCC_TREE_SSANAMES_H */