aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.h
diff options
context:
space:
mode:
authorKewen Lin <linkw@linux.ibm.com>2023-08-09 00:41:52 -0500
committerKewen Lin <linkw@linux.ibm.com>2023-08-09 01:16:05 -0500
commit4a8e6fa8016f8daf184dec49f371ca71b1cb0f01 (patch)
tree92c9a00b4dd97c471e5c7479ac65ec9701d3e912 /gcc/recog.h
parent165b1f6ad1d3969e2c23417797362d0528e65c79 (diff)
downloadgcc-4a8e6fa8016f8daf184dec49f371ca71b1cb0f01.zip
gcc-4a8e6fa8016f8daf184dec49f371ca71b1cb0f01.tar.gz
gcc-4a8e6fa8016f8daf184dec49f371ca71b1cb0f01.tar.bz2
ivopts: Call valid_mem_ref_p with ifn [PR110248]
As PR110248 shows, to get the expected query results for that internal functions LEN_{LOAD,STORE} is able to adopt some addressing modes, we need to pass down the related IFN code as well. This patch is to make IVOPTs pass down ifn code for USE_PTR_ADDRESS type uses, it adjusts the related functions {strict_,}memory_address_addr_space_p, and valid_mem_ref_p as well. PR tree-optimization/110248 gcc/ChangeLog: * recog.cc (memory_address_addr_space_p): Add one more argument ch of type code_helper and pass it to targetm.addr_space.legitimate_address_p instead of ERROR_MARK. (offsettable_address_addr_space_p): Update one function pointer with one more argument of type code_helper as its assignees memory_address_addr_space_p and strict_memory_address_addr_space_p have been adjusted, and adjust some call sites with ERROR_MARK. * recog.h (tree.h): New include header file for tree_code ERROR_MARK. (memory_address_addr_space_p): Adjust with one more unnamed argument of type code_helper with default ERROR_MARK. (strict_memory_address_addr_space_p): Likewise. * reload.cc (strict_memory_address_addr_space_p): Add one unnamed argument of type code_helper. * tree-ssa-address.cc (valid_mem_ref_p): Add one more argument ch of type code_helper and pass it to memory_address_addr_space_p. * tree-ssa-address.h (valid_mem_ref_p): Adjust the declaration with one more unnamed argument of type code_helper with default value ERROR_MARK. * tree-ssa-loop-ivopts.cc (get_address_cost): Use ERROR_MARK as code by default, change it with ifn code for USE_PTR_ADDRESS type use, and pass it to all valid_mem_ref_p calls.
Diffstat (limited to 'gcc/recog.h')
-rw-r--r--gcc/recog.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/recog.h b/gcc/recog.h
index badf8e3..c6ef619 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -20,6 +20,9 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_RECOG_H
#define GCC_RECOG_H
+/* For enum tree_code ERROR_MARK. */
+#include "tree.h"
+
/* Random number that should be large enough for all purposes. Also define
a type that has at least MAX_RECOG_ALTERNATIVES + 1 bits, with the extra
bit giving an invalid value that can be used to mean "uninitialized". */
@@ -200,11 +203,12 @@ extern void temporarily_undo_changes (int);
extern void redo_changes (int);
extern bool constrain_operands (int, alternative_mask);
extern bool constrain_operands_cached (rtx_insn *, int);
-extern bool memory_address_addr_space_p (machine_mode, rtx, addr_space_t);
+extern bool memory_address_addr_space_p (machine_mode, rtx, addr_space_t,
+ code_helper = ERROR_MARK);
#define memory_address_p(mode,addr) \
memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
-extern bool strict_memory_address_addr_space_p (machine_mode, rtx,
- addr_space_t);
+extern bool strict_memory_address_addr_space_p (machine_mode, rtx, addr_space_t,
+ code_helper = ERROR_MARK);
#define strict_memory_address_p(mode,addr) \
strict_memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
extern bool validate_replace_rtx_subexp (rtx, rtx, rtx_insn *, rtx *);