From: Fei Gao <gaofei@eswincomputing.com>
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, palmer@dabbelt.com, jeffreyalaw@gmail.com,
sinan.lin@linux.alibaba.com, jiawei@iscas.ac.cn,
Fei Gao <gaofei@eswincomputing.com>
Subject: [PATCH 1/2] allow target to check shrink-wrap-separate enabled or not
Date: Tue, 20 Jun 2023 09:40:51 +0000 [thread overview]
Message-ID: <20230620094052.35993-2-gaofei@eswincomputing.com> (raw)
In-Reply-To: <20230620094052.35993-1-gaofei@eswincomputing.com>
gcc/ChangeLog:
* shrink-wrap.cc (try_shrink_wrapping_separate):call
use_shrink_wrapping_separate.
(use_shrink_wrapping_separate): wrap the condition
check in use_shrink_wrapping_separate.
* shrink-wrap.h (use_shrink_wrapping_separate): add to extern
---
gcc/shrink-wrap.cc | 25 +++++++++++++++++--------
gcc/shrink-wrap.h | 1 +
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/gcc/shrink-wrap.cc b/gcc/shrink-wrap.cc
index b8d7b557130..d534964321a 100644
--- a/gcc/shrink-wrap.cc
+++ b/gcc/shrink-wrap.cc
@@ -1776,16 +1776,14 @@ insert_prologue_epilogue_for_components (sbitmap components)
commit_edge_insertions ();
}
-/* The main entry point to this subpass. FIRST_BB is where the prologue
- would be normally put. */
-void
-try_shrink_wrapping_separate (basic_block first_bb)
+bool
+use_shrink_wrapping_separate (void)
{
if (!(SHRINK_WRAPPING_ENABLED
- && flag_shrink_wrap_separate
- && optimize_function_for_speed_p (cfun)
- && targetm.shrink_wrap.get_separate_components))
- return;
+ && flag_shrink_wrap_separate
+ && optimize_function_for_speed_p (cfun)
+ && targetm.shrink_wrap.get_separate_components))
+ return false;
/* We don't handle "strange" functions. */
if (cfun->calls_alloca
@@ -1794,6 +1792,17 @@ try_shrink_wrapping_separate (basic_block first_bb)
|| crtl->calls_eh_return
|| crtl->has_nonlocal_goto
|| crtl->saves_all_registers)
+ return false;
+
+ return true;
+}
+
+/* The main entry point to this subpass. FIRST_BB is where the prologue
+ would be normally put. */
+void
+try_shrink_wrapping_separate (basic_block first_bb)
+{
+ if (!use_shrink_wrapping_separate ())
return;
/* Ask the target what components there are. If it returns NULL, don't
diff --git a/gcc/shrink-wrap.h b/gcc/shrink-wrap.h
index 161647711a3..82386c2b712 100644
--- a/gcc/shrink-wrap.h
+++ b/gcc/shrink-wrap.h
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
extern bool requires_stack_frame_p (rtx_insn *, HARD_REG_SET, HARD_REG_SET);
extern void try_shrink_wrapping (edge *entry_edge, rtx_insn *prologue_seq);
extern void try_shrink_wrapping_separate (basic_block first_bb);
+extern bool use_shrink_wrapping_separate (void);
#define SHRINK_WRAPPING_ENABLED \
(flag_shrink_wrap && targetm.have_simple_return ())
--
2.17.1
next prev parent reply other threads:[~2023-06-20 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 9:40 [PATCH 0/2] resolve confilct between RISC-V zcmp and shrink-wrap-separate Fei Gao
2023-06-20 9:40 ` Fei Gao [this message]
2023-06-25 13:36 ` [PATCH 1/2] allow target to check shrink-wrap-separate enabled or not Jeff Law
2023-06-26 2:29 ` Fei Gao
2023-08-28 22:03 ` Jeff Law
2023-08-28 22:32 ` Jeff Law
2023-06-20 9:40 ` [PATCH 2/2] [RISC-V] resolve confilct between zcmp multi push/pop and shrink-wrap-separate Fei Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230620094052.35993-2-gaofei@eswincomputing.com \
--to=gaofei@eswincomputing.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=jiawei@iscas.ac.cn \
--cc=kito.cheng@gmail.com \
--cc=palmer@dabbelt.com \
--cc=sinan.lin@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).