annotate gcc/ifcvt.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* If-conversion header file.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
7 under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
9 any later version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
14 License for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #ifndef GCC_IFCVT_H
kono
parents:
diff changeset
21 #define GCC_IFCVT_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* Structure to group all of the information to process IF-THEN and
kono
parents:
diff changeset
24 IF-THEN-ELSE blocks for the conditional execution support. */
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 struct ce_if_block
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 basic_block test_bb; /* First test block. */
kono
parents:
diff changeset
29 basic_block then_bb; /* THEN block. */
kono
parents:
diff changeset
30 basic_block else_bb; /* ELSE block or NULL. */
kono
parents:
diff changeset
31 basic_block join_bb; /* Join THEN/ELSE blocks. */
kono
parents:
diff changeset
32 basic_block last_test_bb; /* Last bb to hold && or || tests. */
kono
parents:
diff changeset
33 int num_multiple_test_blocks; /* # of && and || basic blocks. */
kono
parents:
diff changeset
34 int num_and_and_blocks; /* # of && blocks. */
kono
parents:
diff changeset
35 int num_or_or_blocks; /* # of || blocks. */
kono
parents:
diff changeset
36 int num_multiple_test_insns; /* # of insns in && and || blocks. */
kono
parents:
diff changeset
37 int and_and_p; /* Complex test is &&. */
kono
parents:
diff changeset
38 int num_then_insns; /* # of insns in THEN block. */
kono
parents:
diff changeset
39 int num_else_insns; /* # of insns in ELSE block. */
kono
parents:
diff changeset
40 int pass; /* Pass number. */
kono
parents:
diff changeset
41 };
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 /* Used by noce_process_if_block to communicate with its subroutines.
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 The subroutines know that A and B may be evaluated freely. They
kono
parents:
diff changeset
46 know that X is a register. They should insert new instructions
kono
parents:
diff changeset
47 before cond_earliest. */
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 struct noce_if_info
kono
parents:
diff changeset
50 {
kono
parents:
diff changeset
51 /* The basic blocks that make up the IF-THEN-{ELSE-,}JOIN block. */
kono
parents:
diff changeset
52 basic_block test_bb, then_bb, else_bb, join_bb;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 /* The jump that ends TEST_BB. */
kono
parents:
diff changeset
55 rtx_insn *jump;
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 /* The jump condition. */
kono
parents:
diff changeset
58 rtx cond;
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 /* Reversed jump condition. */
kono
parents:
diff changeset
61 rtx rev_cond;
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 /* New insns should be inserted before this one. */
kono
parents:
diff changeset
64 rtx_insn *cond_earliest;
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 /* Insns in the THEN and ELSE block. There is always just this
kono
parents:
diff changeset
67 one insns in those blocks. The insns are single_set insns.
kono
parents:
diff changeset
68 If there was no ELSE block, INSN_B is the last insn before
kono
parents:
diff changeset
69 COND_EARLIEST, or NULL_RTX. In the former case, the insn
kono
parents:
diff changeset
70 operands are still valid, as if INSN_B was moved down below
kono
parents:
diff changeset
71 the jump. */
kono
parents:
diff changeset
72 rtx_insn *insn_a, *insn_b;
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 /* The SET_SRC of INSN_A and INSN_B. */
kono
parents:
diff changeset
75 rtx a, b;
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 /* The SET_DEST of INSN_A. */
kono
parents:
diff changeset
78 rtx x;
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 /* The original set destination that the THEN and ELSE basic blocks finally
kono
parents:
diff changeset
81 write their result to. */
kono
parents:
diff changeset
82 rtx orig_x;
kono
parents:
diff changeset
83 /* True if this if block is not canonical. In the canonical form of
kono
parents:
diff changeset
84 if blocks, the THEN_BB is the block reached via the fallthru edge
kono
parents:
diff changeset
85 from TEST_BB. For the noce transformations, we allow the symmetric
kono
parents:
diff changeset
86 form as well. */
kono
parents:
diff changeset
87 bool then_else_reversed;
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 /* True if the contents of then_bb and else_bb are a
kono
parents:
diff changeset
90 simple single set instruction. */
kono
parents:
diff changeset
91 bool then_simple;
kono
parents:
diff changeset
92 bool else_simple;
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 /* True if we're optimisizing the control block for speed, false if
kono
parents:
diff changeset
95 we're optimizing for size. */
kono
parents:
diff changeset
96 bool speed_p;
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 /* An estimate of the original costs. When optimizing for size, this is the
kono
parents:
diff changeset
99 combined cost of COND, JUMP and the costs for THEN_BB and ELSE_BB.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
100 When optimizing for speed, we use the costs of COND plus weighted average
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
101 of the costs for THEN_BB and ELSE_BB, as computed in the next field. */
111
kono
parents:
diff changeset
102 unsigned int original_cost;
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 /* Maximum permissible cost for the unconditional sequence we should
kono
parents:
diff changeset
105 generate to replace this branch. */
kono
parents:
diff changeset
106 unsigned int max_seq_cost;
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 /* The name of the noce transform that succeeded in if-converting
kono
parents:
diff changeset
109 this structure. Used for debugging. */
kono
parents:
diff changeset
110 const char *transform_name;
kono
parents:
diff changeset
111 };
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 #endif /* GCC_IFCVT_H */