RISC-V: Add check for types without insn reservations

Message ID 20231101181713.54765-1-ewlu@rivosinc.com
State Unresolved
Headers
Series RISC-V: Add check for types without insn reservations |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Edwin Lu Nov. 1, 2023, 6:17 p.m. UTC
  Now that all insns are guaranteed to have a type, ensure every insn
is associated with a cpu unit/insn reservation.

gcc/ChangeLog:

	* config/riscv/riscv.cc (riscv_sched_variable_issue): add disabled assert

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
---
 gcc/config/riscv/riscv.cc | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Jeff Law Nov. 1, 2023, 6:53 p.m. UTC | #1
On 11/1/23 12:17, Edwin Lu wrote:
> Now that all insns are guaranteed to have a type, ensure every insn
> is associated with a cpu unit/insn reservation.
> 
> gcc/ChangeLog:
> 
> 	* config/riscv/riscv.cc (riscv_sched_variable_issue): add disabled assert
OK.  Really interested to see how often this trips in practice.  I 
suspect often right now ;-)

jeff
>
  
Edwin Lu Nov. 2, 2023, 11:01 p.m. UTC | #2
On 11/1/2023 11:53 AM, Jeff Law wrote:
> 
> 
> On 11/1/23 12:17, Edwin Lu wrote:
>> Now that all insns are guaranteed to have a type, ensure every insn
>> is associated with a cpu unit/insn reservation.
>>
>> gcc/ChangeLog:
>>
>>     * config/riscv/riscv.cc (riscv_sched_variable_issue): add disabled 
>> assert
> OK.  Really interested to see how often this trips in practice.  I 
> suspect often right now ;-)
> 
Committed! On a local test with just rv64gc, actually not that many 
types were tripped. I think there were around 13 that weren't part of 
any reservation

Edwin
> jeff
>>
>
  

Patch

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 0148a4f2e43..0bfd06902e5 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -7751,6 +7751,12 @@  riscv_sched_variable_issue (FILE *, int, rtx_insn *insn, int more)
      an assert so we can find and fix this problem.  */
   gcc_assert (get_attr_type (insn) != TYPE_UNKNOWN);
 
+  /* If we ever encounter an insn without an insn reservation, trip
+     an assert so we can find and fix this problem.  */
+#if 0
+  gcc_assert (insn_has_dfa_reservation_p (insn));
+#endif
+
   return more - 1;
 }