GCC Middle and Back End API Reference
gcse-common.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "df.h"
#include "gcse-common.h"
Include dependency graph for gcse-common.cc:

Functions

void canon_list_insert (rtx dest, const_rtx x, void *data)
 
void record_last_mem_set_info_common (rtx_insn *insn, vec< rtx_insn * > *modify_mem_list, vec< modify_pair > *canon_modify_mem_list, bitmap modify_mem_list_set, bitmap blocks_with_calls)
 
void compute_transp (const_rtx x, int indx, sbitmap *bmap, bitmap blocks_with_calls, bitmap modify_mem_list_set, vec< modify_pair > *canon_modify_mem_list)
 

Function Documentation

◆ canon_list_insert()

void canon_list_insert ( rtx dest,
const_rtx x,
void * data )
Shared code for before and after reload gcse implementations.
Copyright (C) 1997-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>. 

It is expected that more hunks of gcse.cc and postreload-gcse.cc should
migrate into this file.   
Record all of the canonicalized MEMs of record_last_mem_set_info's insn.
Note we store a pair of elements in the list, so they have to be
taken off pairwise.   

References BLOCK_FOR_INSN(), gcse_note_stores_info::canon_mem_list, canon_rtx(), get_addr(), GET_CODE, ggc_alloc(), basic_block_def::index, gcse_note_stores_info::insn, MEM_P, and XEXP.

Referenced by record_last_mem_set_info_common().

◆ compute_transp()

void compute_transp ( const_rtx x,
int indx,
sbitmap * bmap,
bitmap blocks_with_calls,
bitmap modify_mem_list_set,
vec< modify_pair > * canon_modify_mem_list )
For each block, compute whether X is transparent.  X is either an
expression or an assignment [though we don't care which, for this context
an assignment is treated as an expression].  For each block where an
element of X is modified, reset the INDX bit in BMAP. 

BLOCKS_WITH_CALLS indicates which blocks contain CALL_INSNs which kill
memory.

MODIFY_MEM_LIST_SET indicates which blocks have memory stores which might
kill a particular memory location.

CANON_MODIFY_MEM_LIST is the canonicalized list of memory locations modified
for each block.   

References bitmap_clear_bit(), blocks_with_calls, canon_modify_mem_list, canon_rtx(), canon_true_dependence(), CASE_CONST_ANY, compute_transp(), DF_REF_BB, DF_REF_NEXT_REG, DF_REG_DEF_CHAIN, EXECUTE_IF_AND_COMPL_IN_BITMAP, EXECUTE_IF_SET_IN_BITMAP, FOR_EACH_VEC_ELT_REVERSE, get_addr(), GET_CODE, GET_MODE, GET_RTX_FORMAT, GET_RTX_LENGTH, ggc_alloc(), i, MEM_READONLY_P, modify_mem_list_set, REGNO, XEXP, XVECEXP, and XVECLEN.

Referenced by compute_expr_transp(), compute_local_properties(), and compute_transp().

◆ record_last_mem_set_info_common()

void record_last_mem_set_info_common ( rtx_insn * insn,
vec< rtx_insn * > * modify_mem_list,
vec< modify_pair > * canon_modify_mem_list,
bitmap modify_mem_list_set,
bitmap blocks_with_calls )
Record memory modification information for INSN.  We do not actually care
about the memory location(s) that are set, or even how they are set (consider
a CALL_INSN).  We merely need to record which insns modify memory.   

References bitmap_set_bit, BLOCK_FOR_INSN(), blocks_with_calls, CALL_P, canon_list_insert(), canon_modify_mem_list, basic_block_def::index, gcse_note_stores_info::insn, modify_mem_list, modify_mem_list_set, and note_stores().

Referenced by record_last_mem_set_info(), and record_last_mem_set_info().