public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/108248] New: Some insns in the risc-v backend do not have mappings to functional units
@ 2022-12-28 20:41 law at gcc dot gnu.org
  2022-12-29  0:47 ` [Bug target/108248] " andrew at sifive dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: law at gcc dot gnu.org @ 2022-12-28 20:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108248

            Bug ID: 108248
           Summary: Some insns in the risc-v backend do not have mappings
                    to functional units
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
                CC: rzinsly at ventanamicro dot com
  Target Milestone: ---
            Target: risc-v

If you review scheduling dumps for risc-v you will see various insns with no
reservations.  For example:

;;       11--> b  3: i  58 r184=smax(r154,r183)                    :nothing
;;        3--> b  3: i  55 r182=r180<<0x3+r160                     :nothing
;;        8--> b  0: i  16 r167=r193<<0x3+r193                     :nothing
;;       13--> b  0: i  19 r155=r167<<0x3+r188                     :nothing
;;        0--> b  0: i  26 r172=r164<<0x3+r164                     :nothing
;;        2--> b  0: i  23 r144=r161<<0x3+r159                     :nothing

It's worth noting these all seem to be coming from the bitmanip extensions. 
However, there well could be others.

It would be advisable to ensure that all insns have appropriate mappings to
functional units.

This patch from Jivan would help, but I think a thorough review to ensure
everything has a mapping would be advisable:
diff --git a/gcc/config/riscv/generic.md b/gcc/config/riscv/generic.md
index 1a209dcb997..296c4e24923 100644
--- a/gcc/config/riscv/generic.md
+++ b/gcc/config/riscv/generic.md
@@ -88,3 +88,8 @@
   (and (eq_attr "tune" "generic")
        (eq_attr "type" "fsqrt"))
   "fdivsqrt*25")
+
+(define_insn_reservation "generic_smax" 1
+  (and (eq_attr "tune" "generic")
+       (eq_attr "type" "bitmanip"))
+  "alu")

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

end of thread, other threads:[~2023-04-20 14:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28 20:41 [Bug target/108248] New: Some insns in the risc-v backend do not have mappings to functional units law at gcc dot gnu.org
2022-12-29  0:47 ` [Bug target/108248] " andrew at sifive dot com
2022-12-29  1:28 ` law at gcc dot gnu.org
2022-12-29  1:49 ` andrew at sifive dot com
2022-12-29  2:08 ` law at gcc dot gnu.org
2023-02-22  2:22 ` law at gcc dot gnu.org
2023-02-22  6:49 ` pinskia at gcc dot gnu.org
2023-04-20 14:50 ` cvs-commit at gcc dot gnu.org
2023-04-20 14:50 ` law at gcc dot gnu.org

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