[committed] amdgcn: silence warnings

Message ID 80c4653a-1838-416d-bd78-17a338c61fb2@codesourcery.com
State Accepted
Headers
Series [committed] amdgcn: silence warnings |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Andrew Stubbs Oct. 27, 2023, 5:04 p.m. UTC
  This trivial patch adds the "operands" keyword to the condition in a 
couple of patterns that cause warnings about "missing" mode specifiers.

With the iterators, there were a large number of warnings about these 
cases that have now been silenced.

Andrew
amdgcn: silence warnings

The operands really should be VOIDmode, so the warnings are false.

gcc/ChangeLog:

	* config/gcn/gcn-valu.md
	(vec_extract<V_1REG:mode><V_1REG_ALT:mode>_nop): Mention "operands" in
	condition to silence the warnings.
	(vec_extract<V_2REG:mode><V_2REG_ALT:mode>_nop): Likewise.
	* config/gcn/gcn.md (*movti_insn): Likewise.
  

Patch

diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md
index c128c819c89..39c1dc5b7b4 100644
--- a/gcc/config/gcn/gcn-valu.md
+++ b/gcc/config/gcn/gcn-valu.md
@@ -948,7 +948,8 @@  (define_insn "vec_extract<V_1REG:mode><V_1REG_ALT:mode>_nop"
 	  (match_operand:V_1REG 1 "register_operand"   " 0,v")
 	  (match_operand 2 "ascending_zero_int_parallel" "")))]
   "MODE_VF (<V_1REG_ALT:MODE>mode) < MODE_VF (<V_1REG:MODE>mode)
-   && <V_1REG_ALT:SCALAR_MODE>mode == <V_1REG:SCALAR_MODE>mode"
+   && <V_1REG_ALT:SCALAR_MODE>mode == <V_1REG:SCALAR_MODE>mode
+   /* This comment silences a warning for operands[2]. */"
   "@
   ; in-place extract %0
   v_mov_b32\t%L0, %L1"
@@ -961,7 +962,8 @@  (define_insn "vec_extract<V_2REG:mode><V_2REG_ALT:mode>_nop"
 	  (match_operand:V_2REG 1 "register_operand"   " 0,v")
 	  (match_operand 2 "ascending_zero_int_parallel" "")))]
   "MODE_VF (<V_2REG_ALT:MODE>mode) < MODE_VF (<V_2REG:MODE>mode)
-   && <V_2REG_ALT:SCALAR_MODE>mode == <V_2REG:SCALAR_MODE>mode"
+   && <V_2REG_ALT:SCALAR_MODE>mode == <V_2REG:SCALAR_MODE>mode
+   /* This comment silences a warning for operands[2]. */"
   "@
   ; in-place extract %0
   v_mov_b32\t%L0, %L1\;v_mov_b32\t%H0, %H1"
diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md
index a3d8beefd6d..e6a9ac60b57 100644
--- a/gcc/config/gcn/gcn.md
+++ b/gcc/config/gcn/gcn.md
@@ -694,7 +694,7 @@  (define_insn_and_split "*movti_insn"
 
 (define_insn "prologue_use"
   [(unspec_volatile [(match_operand 0 "register_operand")] UNSPECV_PROLOGUE_USE)]
-  ""
+  "1 /* This comment silences a warning for operands[2]. */"
   ""
   [(set_attr "length" "0")])