[1/3] testsuite: Add tail_call effective target
Checks
Commit Message
Ok to commit?
-- >8 --
The RTL "expand" dump is the first RTL dump, and it also appears to be
the earliest trace of the target having implemented sibcalls.
Including the "," in the pattern searched for, to try and avoid
possible false matches, but there doesn't appear to be any identifiers
or target names nearby so this is just belts and suspenders. Using
"tail_call" as a shorter and more commonly used term than a derivative
of "sibling calls", and expecting only gcc folks to have heard of
"sibcalls".
* lib/target-supports.exp (check_effective_target_tail_call): New.
---
gcc/testsuite/lib/target-supports.exp | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
On Mar 6, 2023, at 10:45 AM, Hans-Peter Nilsson via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>
> Ok to commit?
Ok.
> -- >8 --
> The RTL "expand" dump is the first RTL dump, and it also appears to be
> the earliest trace of the target having implemented sibcalls.
> Including the "," in the pattern searched for, to try and avoid
> possible false matches, but there doesn't appear to be any identifiers
> or target names nearby so this is just belts and suspenders. Using
> "tail_call" as a shorter and more commonly used term than a derivative
> of "sibling calls", and expecting only gcc folks to have heard of
> "sibcalls".
>
> * lib/target-supports.exp (check_effective_target_tail_call): New.
@@ -11684,6 +11684,15 @@ proc check_effective_target_frame_pointer_for_non_leaf { } {
return 0
}
+# Return 1 if the target can perform tail-call optimizations of the
+# most trivial type.
+proc check_effective_target_tail_call { } {
+ return [check_no_messages_and_pattern tail_call ",SIBCALL" rtl-expand {
+ __attribute__((__noipa__)) void foo (void) { }
+ __attribute__((__noipa__)) void bar (void) { foo(); }
+ } {-O2 -fdump-rtl-expand-all}] ;# The "SIBCALL" note requires a detailed dump.
+}
+
# Return 1 if the target's calling sequence or its ABI
# create implicit stack probes at or prior to function entry.
proc check_effective_target_caller_implicit_probes { } {