middle-end: Remove integer_three_node [PR116537]

After the small expansion patch for __builtin_prefetch, the
only use of integer_three_node is inside tree-ssa-loop-prefetch.cc so let's
remove it as the loop prefetch pass is not enabled these days by default and
having a tree node around just for that pass is a little wasteful. Integer
constants are also shared these days so calling build_int_cst will use the cached
node anyways.

Bootstrapped and tested on x86_64-linux.

	PR middle-end/116537

gcc/ChangeLog:

	* tree-core.h (enum tree_index): Remove TI_INTEGER_THREE
	* tree-ssa-loop-prefetch.cc (issue_prefetch_ref): Call build_int_cst
	instead of using integer_three_node.
	* tree.cc (build_common_tree_nodes): Remove initialization
	of integer_three_node.
	* tree.h (integer_three_node): Delete.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
This commit is contained in:
Andrew Pinski 2024-08-29 11:01:56 -07:00
parent 04d11ded01
commit 4d2cbe2bbe
4 changed files with 1 additions and 4 deletions

View file

@ -662,7 +662,6 @@ enum tree_index : unsigned {
TI_INTEGER_ZERO,
TI_INTEGER_ONE,
TI_INTEGER_THREE,
TI_INTEGER_MINUS_ONE,
TI_NULL_POINTER,

View file

@ -1183,7 +1183,7 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
addr_base = force_gimple_operand_gsi (&bsi, unshare_expr (addr_base),
true, NULL, true, GSI_SAME_STMT);
write_p = ref->write_p ? integer_one_node : integer_zero_node;
local = nontemporal ? integer_zero_node : integer_three_node;
local = nontemporal ? integer_zero_node : build_int_cst (integer_type_node, 3);
for (ap = 0; ap < n_prefetches; ap++)
{

View file

@ -9567,7 +9567,6 @@ build_common_tree_nodes (bool signed_char)
/* Define these next since types below may used them. */
integer_zero_node = build_int_cst (integer_type_node, 0);
integer_one_node = build_int_cst (integer_type_node, 1);
integer_three_node = build_int_cst (integer_type_node, 3);
integer_minus_one_node = build_int_cst (integer_type_node, -1);
size_zero_node = size_int (0);

View file

@ -4444,7 +4444,6 @@ tree_strip_any_location_wrapper (tree exp)
#define integer_zero_node global_trees[TI_INTEGER_ZERO]
#define integer_one_node global_trees[TI_INTEGER_ONE]
#define integer_three_node global_trees[TI_INTEGER_THREE]
#define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
#define size_zero_node global_trees[TI_SIZE_ZERO]
#define size_one_node global_trees[TI_SIZE_ONE]