aboutsummaryrefslogtreecommitdiff
path: root/gcc/function-abi.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function-abi.h')
-rw-r--r--gcc/function-abi.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/function-abi.h b/gcc/function-abi.h
index edf83c1..6cb552f 100644
--- a/gcc/function-abi.h
+++ b/gcc/function-abi.h
@@ -99,6 +99,39 @@ public:
return m_full_and_partial_reg_clobbers;
}
+ /* Return the set of registers that a function call is allowed to alter
+ partially but not fully; i.e. those in full_and_partial_reg_clobbers ()
+ but not in full_reg_clobbers ().
+
+ If a register X is in this set and if we don't know which parts of
+ X are live (typically because we don't bother to track X's mode),
+ then the conservative assumptions are:
+
+ - to ignore the call when computing reaching definitions
+ - to treat X as clobbered when computing availability
+
+ For example, if we have:
+
+ A: X := Y
+ B: call that partially clobbers X
+ C: ... := ... X ...
+
+ and don't track the mode of X when computing reaching definitions,
+ then the conservative assumption is that A's definition survives
+ until C. But if we have:
+
+ A: X := Y
+ B: call that partially clobbers X
+ C: ... := ... Y ...
+
+ and don't track the mode of X when computing availability, then the
+ conservative assumption is that Y is not available in X at C. */
+ HARD_REG_SET
+ only_partial_reg_clobbers () const
+ {
+ return full_and_partial_reg_clobbers () & ~full_reg_clobbers ();
+ }
+
/* Return the set of registers that cannot be used to hold a value of
mode MODE across a function call. That is:
@@ -166,6 +199,12 @@ public:
}
HARD_REG_SET
+ only_partial_reg_clobbers () const
+ {
+ return m_mask & m_base_abi->only_partial_reg_clobbers ();
+ }
+
+ HARD_REG_SET
mode_clobbers (machine_mode mode) const
{
return m_mask & m_base_abi->mode_clobbers (mode);