aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-12-17 00:15:07 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2020-12-17 00:15:07 +0000
commiteb74135dd35213f800f434df92b2835ce49f8ea6 (patch)
tree7b9bc5b0bd2a9e257ed765d0fa8a057877c5b0f4 /gcc/recog.h
parent6059a3dd084d157759309357e5a52f8a8cc504c1 (diff)
downloadgcc-eb74135dd35213f800f434df92b2835ce49f8ea6.zip
gcc-eb74135dd35213f800f434df92b2835ce49f8ea6.tar.gz
gcc-eb74135dd35213f800f434df92b2835ce49f8ea6.tar.bz2
recog: Add a way of temporarily undoing changes
In some cases, it can be convenient to roll back the changes that have been made by validate_change to see how things looked before, then reroll the changes. For example, this makes it possible to defer calculating the cost of an instruction until we know that the result is actually needed. It can also make dumps easier to read. This patch adds a couple of helper functions for doing that. gcc/ * recog.h (temporarily_undo_changes, redo_changes): Declare. * recog.c (temporarily_undone_changes): New variable. (validate_change_1, confirm_change_group): Check that it's zero. (cancel_changes): Likewise. (swap_change, temporarily_undo_changes): New functions. (redo_changes): Likewise.
Diffstat (limited to 'gcc/recog.h')
-rw-r--r--gcc/recog.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/recog.h b/gcc/recog.h
index e152e2b..facf36e 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -96,6 +96,8 @@ extern void confirm_change_group (void);
extern int apply_change_group (void);
extern int num_validated_changes (void);
extern void cancel_changes (int);
+extern void temporarily_undo_changes (int);
+extern void redo_changes (int);
extern int constrain_operands (int, alternative_mask);
extern int constrain_operands_cached (rtx_insn *, int);
extern int memory_address_addr_space_p (machine_mode, rtx, addr_space_t);