public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] arc: Fix for new ifcvt behavior [PR104154]
@ 2022-02-21  7:56 Robin Dapp
  2022-02-28 12:44 ` Claudiu Zissulescu Ianculescu
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Dapp @ 2022-02-21  7:56 UTC (permalink / raw)
  To: GCC Patches, Jeff Law; +Cc: hp, jsm28

Hi,

I figured I'd just go ahead and post this patch as well since it seems
to have fixed the arc build problems.

It would be nice if someone could bootstrap/regtest if Jeff hasn't
already done so.  I was able to verify that the two testcases attached
to the PR build cleanly but not much more.  Thank you.

Regards
 Robin

--

        PR104154

gcc/ChangeLog:

        * config/arc/arc.cc (gen_compare_reg):  Return the CC-mode
        comparison ifcvt passed us.

---

From fa98a40abd55e3a10653f6a8c5b2414a2025103b Mon Sep 17 00:00:00 2001
From: Robin Dapp <rdapp@linux.ibm.com>
Date: Mon, 7 Feb 2022 08:39:41 +0100
Subject: [PATCH] arc: Fix for new ifcvt behavior [PR104154]

ifcvt now passes a CC-mode "comparison" to backends.  This patch
simply returns from gen_compare_reg () in that case since nothing
needs to be prepared anymore.

	PR104154

gcc/ChangeLog:

	* config/arc/arc.cc (gen_compare_reg):  Return the CC-mode
	comparison ifcvt passed us.
---
 gcc/config/arc/arc.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/config/arc/arc.cc b/gcc/config/arc/arc.cc
index 8cc173519ab..5e40ec2c04d 100644
--- a/gcc/config/arc/arc.cc
+++ b/gcc/config/arc/arc.cc
@@ -2254,6 +2254,12 @@ gen_compare_reg (rtx comparison, machine_mode omode)


   cmode = GET_MODE (x);
+
+  /* If ifcvt passed us a MODE_CC comparison we can
+     just return it.  It should be in the proper form already.   */
+  if (GET_MODE_CLASS (cmode) == MODE_CC)
+    return comparison;
+
   if (cmode == VOIDmode)
     cmode = GET_MODE (y);
   gcc_assert (cmode == SImode || cmode == SFmode || cmode == DFmode);
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arc: Fix for new ifcvt behavior [PR104154]
  2022-02-21  7:56 [PATCH] arc: Fix for new ifcvt behavior [PR104154] Robin Dapp
@ 2022-02-28 12:44 ` Claudiu Zissulescu Ianculescu
  2022-03-01  8:06   ` Robin Dapp
  0 siblings, 1 reply; 3+ messages in thread
From: Claudiu Zissulescu Ianculescu @ 2022-02-28 12:44 UTC (permalink / raw)
  To: Robin Dapp; +Cc: GCC Patches, Jeff Law, hp, jsm28

Hi Robin,

The patch looks good. Please go ahead and merge it, please let me know if
you cannot.

Thank you,
Claudiu

On Mon, Feb 21, 2022 at 9:57 AM Robin Dapp via Gcc-patches <
gcc-patches@gcc.gnu.org> wrote:

> Hi,
>
> I figured I'd just go ahead and post this patch as well since it seems
> to have fixed the arc build problems.
>
> It would be nice if someone could bootstrap/regtest if Jeff hasn't
> already done so.  I was able to verify that the two testcases attached
> to the PR build cleanly but not much more.  Thank you.
>
> Regards
>  Robin
>
> --
>
>         PR104154
>
> gcc/ChangeLog:
>
>         * config/arc/arc.cc (gen_compare_reg):  Return the CC-mode
>         comparison ifcvt passed us.
>
> ---
>
> From fa98a40abd55e3a10653f6a8c5b2414a2025103b Mon Sep 17 00:00:00 2001
> From: Robin Dapp <rdapp@linux.ibm.com>
> Date: Mon, 7 Feb 2022 08:39:41 +0100
> Subject: [PATCH] arc: Fix for new ifcvt behavior [PR104154]
>
> ifcvt now passes a CC-mode "comparison" to backends.  This patch
> simply returns from gen_compare_reg () in that case since nothing
> needs to be prepared anymore.
>
>         PR104154
>
> gcc/ChangeLog:
>
>         * config/arc/arc.cc (gen_compare_reg):  Return the CC-mode
>         comparison ifcvt passed us.
> ---
>  gcc/config/arc/arc.cc | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/gcc/config/arc/arc.cc b/gcc/config/arc/arc.cc
> index 8cc173519ab..5e40ec2c04d 100644
> --- a/gcc/config/arc/arc.cc
> +++ b/gcc/config/arc/arc.cc
> @@ -2254,6 +2254,12 @@ gen_compare_reg (rtx comparison, machine_mode omode)
>
>
>    cmode = GET_MODE (x);
> +
> +  /* If ifcvt passed us a MODE_CC comparison we can
> +     just return it.  It should be in the proper form already.   */
> +  if (GET_MODE_CLASS (cmode) == MODE_CC)
> +    return comparison;
> +
>    if (cmode == VOIDmode)
>      cmode = GET_MODE (y);
>    gcc_assert (cmode == SImode || cmode == SFmode || cmode == DFmode);
> --
> 2.31.1
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arc: Fix for new ifcvt behavior [PR104154]
  2022-02-28 12:44 ` Claudiu Zissulescu Ianculescu
@ 2022-03-01  8:06   ` Robin Dapp
  0 siblings, 0 replies; 3+ messages in thread
From: Robin Dapp @ 2022-03-01  8:06 UTC (permalink / raw)
  To: Claudiu Zissulescu Ianculescu; +Cc: GCC Patches, Jeff Law, hp, jsm28

Hi Claudiu,

> The patch looks good. Please go ahead and merge it, please let me know if
> you cannot.

I merged the patch leaving your check

  if (cmode != SImode && cmode != SFmode && cmode != DFmode)


    return NULL_RTX;

in place.  It is not strictly necessary anymore but I figured it also
kind of documents the preconditions of the code that follows.

Regards
 Robin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-01  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21  7:56 [PATCH] arc: Fix for new ifcvt behavior [PR104154] Robin Dapp
2022-02-28 12:44 ` Claudiu Zissulescu Ianculescu
2022-03-01  8:06   ` Robin Dapp

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).