aboutsummaryrefslogtreecommitdiff
path: root/gcc/df.h
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-06-15 07:33:04 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-06-15 07:33:04 +0000
commit74e59b6c24b6770010a76247c1c44abdf2fe92bf (patch)
treeade4c61474f0cf78ce51f16f74ba9dd522d0d440 /gcc/df.h
parentfc8e9f583cf683a397fef637af4b170fda429021 (diff)
downloadgcc-74e59b6c24b6770010a76247c1c44abdf2fe92bf.zip
gcc-74e59b6c24b6770010a76247c1c44abdf2fe92bf.tar.gz
gcc-74e59b6c24b6770010a76247c1c44abdf2fe92bf.tar.bz2
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
Diffstat (limited to 'gcc/df.h')
-rw-r--r--gcc/df.h19
1 files changed, 19 insertions, 0 deletions
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 */