* [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742]
@ 2024-02-05 3:20 Monk Chiang
2024-02-05 3:28 ` Jeff Law
2024-02-13 16:03 ` Jeff Law
0 siblings, 2 replies; 6+ messages in thread
From: Monk Chiang @ 2024-02-05 3:20 UTC (permalink / raw)
To: gcc-patches, kito.cheng, philipp.tomsich, zsojka; +Cc: Monk Chiang
gcc/ChangeLog:
PR target/113742
* config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Fix
recognizes UNSPEC_AUIPC for RISCV_FUSE_LUI_ADDI.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/pr113742.c: New test.
---
gcc/config/riscv/riscv.cc | 2 +-
gcc/testsuite/gcc.target/riscv/pr113742.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.target/riscv/pr113742.c
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 799d7919a4a..4100abc9dd1 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -8434,7 +8434,7 @@ riscv_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr)
(lo_sum:DI (reg:DI rD) (const_int IMM12))) */
if (GET_CODE (SET_SRC (prev_set)) == UNSPEC
- && XINT (prev_set, 1) == UNSPEC_AUIPC
+ && XINT (SET_SRC (prev_set), 1) == UNSPEC_AUIPC
&& (GET_CODE (SET_SRC (curr_set)) == LO_SUM
|| (GET_CODE (SET_SRC (curr_set)) == PLUS
&& SMALL_OPERAND (INTVAL (XEXP (SET_SRC (curr_set), 1))))))
diff --git a/gcc/testsuite/gcc.target/riscv/pr113742.c b/gcc/testsuite/gcc.target/riscv/pr113742.c
new file mode 100644
index 00000000000..ab8934c2a8a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr113742.c
@@ -0,0 +1,4 @@
+//* { dg-do compile } */
+/* { dg-options "-O2 -finstrument-functions -mabi=lp64d -mcpu=sifive-p670" } */
+
+void foo(void) {}
--
2.40.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742]
2024-02-05 3:20 [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742] Monk Chiang
@ 2024-02-05 3:28 ` Jeff Law
2024-02-05 5:57 ` Monk Chiang
2024-02-13 16:03 ` Jeff Law
1 sibling, 1 reply; 6+ messages in thread
From: Jeff Law @ 2024-02-05 3:28 UTC (permalink / raw)
To: Monk Chiang, gcc-patches, kito.cheng, philipp.tomsich, zsojka
On 2/4/24 20:20, Monk Chiang wrote:
> gcc/ChangeLog:
>
> PR target/113742
> * config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Fix
> recognizes UNSPEC_AUIPC for RISCV_FUSE_LUI_ADDI.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/riscv/pr113742.c: New test.
OK. Presumably this faulted during an --enable-checking=rtl build or
something similar?
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742]
2024-02-05 3:28 ` Jeff Law
@ 2024-02-05 5:57 ` Monk Chiang
0 siblings, 0 replies; 6+ messages in thread
From: Monk Chiang @ 2024-02-05 5:57 UTC (permalink / raw)
To: Jeff Law; +Cc: gcc-patches, kito.cheng, philipp.tomsich, zsojka
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
Yes, this test needs "--enable-checking=rtl" build.
On Mon, Feb 5, 2024 at 11:28 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
> On 2/4/24 20:20, Monk Chiang wrote:
> > gcc/ChangeLog:
> >
> > PR target/113742
> > * config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Fix
> > recognizes UNSPEC_AUIPC for RISCV_FUSE_LUI_ADDI.
> >
> > gcc/testsuite/ChangeLog:
> >
> > * gcc.target/riscv/pr113742.c: New test.
> OK. Presumably this faulted during an --enable-checking=rtl build or
> something similar?
>
> Jeff
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742]
2024-02-05 3:20 [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742] Monk Chiang
2024-02-05 3:28 ` Jeff Law
@ 2024-02-13 16:03 ` Jeff Law
2024-02-14 3:42 ` Monk Chiang
2024-02-14 3:42 ` Monk Chiang
1 sibling, 2 replies; 6+ messages in thread
From: Jeff Law @ 2024-02-13 16:03 UTC (permalink / raw)
To: Monk Chiang, gcc-patches, kito.cheng, philipp.tomsich, zsojka
On 2/4/24 20:20, Monk Chiang wrote:
> gcc/ChangeLog:
>
> PR target/113742
> * config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Fix
> recognizes UNSPEC_AUIPC for RISCV_FUSE_LUI_ADDI.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/riscv/pr113742.c: New test.
I was going through the patchwork queue after the call today and it
looks like this didn't get pushed. So I took care of it.
Thanks again,
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742]
2024-02-13 16:03 ` Jeff Law
@ 2024-02-14 3:42 ` Monk Chiang
2024-02-14 3:42 ` Monk Chiang
1 sibling, 0 replies; 6+ messages in thread
From: Monk Chiang @ 2024-02-14 3:42 UTC (permalink / raw)
To: Jeff Law; +Cc: gcc-patches, kito.cheng, philipp.tomsich, zsojka
Hi Jeff,
I don't have permission to commit, can you push it for me? If you look good to you.
> Jeff Law <jeffreyalaw@gmail.com> 於 2024年2月14日 凌晨12:03 寫道:
>
>
>
>> On 2/4/24 20:20, Monk Chiang wrote:
>> gcc/ChangeLog:
>> PR target/113742
>> * config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Fix
>> recognizes UNSPEC_AUIPC for RISCV_FUSE_LUI_ADDI.
>> gcc/testsuite/ChangeLog:
>> * gcc.target/riscv/pr113742.c: New test.
> I was going through the patchwork queue after the call today and it looks like this didn't get pushed. So I took care of it.
>
> Thanks again,
> Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742]
2024-02-13 16:03 ` Jeff Law
2024-02-14 3:42 ` Monk Chiang
@ 2024-02-14 3:42 ` Monk Chiang
1 sibling, 0 replies; 6+ messages in thread
From: Monk Chiang @ 2024-02-14 3:42 UTC (permalink / raw)
To: Jeff Law; +Cc: gcc-patches, kito.cheng, philipp.tomsich, zsojka
Hi Jeff,
I don't have permission to commit, can you push it for me? If you look good to you.
> Jeff Law <jeffreyalaw@gmail.com> 於 2024年2月14日 凌晨12:03 寫道:
>
>
>
>> On 2/4/24 20:20, Monk Chiang wrote:
>> gcc/ChangeLog:
>> PR target/113742
>> * config/riscv/riscv.cc (riscv_macro_fusion_pair_p): Fix
>> recognizes UNSPEC_AUIPC for RISCV_FUSE_LUI_ADDI.
>> gcc/testsuite/ChangeLog:
>> * gcc.target/riscv/pr113742.c: New test.
> I was going through the patchwork queue after the call today and it looks like this didn't get pushed. So I took care of it.
>
> Thanks again,
> Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-02-14 3:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 3:20 [PATCH] RISC-V: Fix macro fusion for auipc+add, when identifying UNSPEC_AUIPC. [PR113742] Monk Chiang
2024-02-05 3:28 ` Jeff Law
2024-02-05 5:57 ` Monk Chiang
2024-02-13 16:03 ` Jeff Law
2024-02-14 3:42 ` Monk Chiang
2024-02-14 3:42 ` Monk Chiang
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).