From 74e59b6c24b6770010a76247c1c44abdf2fe92bf Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sun, 15 Jun 2014 07:33:04 +0000 Subject: df.h (df_single_def, [...]): New functions. gcc/ * df.h (df_single_def, df_single_use): New functions. * ira.c (find_moveable_pseudos): Use them. From-SVN: r211681 --- gcc/df.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gcc/df.h') diff --git a/gcc/df.h b/gcc/df.h index 9ec8ae1..73c0972 100644 --- a/gcc/df.h +++ b/gcc/df.h @@ -1165,6 +1165,25 @@ df_get_artificial_uses (unsigned int bb_index) return df_scan_get_bb_info (bb_index)->artificial_uses; } +/* If INSN defines exactly one register, return the associated reference, + otherwise return null. */ + +static inline df_ref +df_single_def (const df_insn_info *info) +{ + df_ref *defs = DF_INSN_INFO_DEFS (info); + return defs[0] && !defs[1] ? defs[0] : NULL; +} + +/* If INSN uses exactly one register, return the associated reference, + otherwise return null. */ + +static inline df_ref +df_single_use (const df_insn_info *info) +{ + df_ref *uses = DF_INSN_INFO_USES (info); + return uses[0] && !uses[1] ? uses[0] : NULL; +} /* web */ -- cgit v1.1