]> gcc.gnu.org Git - gcc.git/commitdiff
Add verification of gimple_assign_nontemporal_move_p [PR112976]
authorAndrew Pinski <quic_apinski@quicinc.com>
Wed, 17 Apr 2024 21:12:17 +0000 (14:12 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Tue, 30 Apr 2024 15:55:19 +0000 (08:55 -0700)
Currently the middle-end only knows how to support temporal stores
(the undocumented storent optab) so let's verify that the only time
we set nontemporal_move on an assign is if the the lhs is not a
gimple reg.

Bootstrapped and tested on x86_64-linux-gnu no regressions.

gcc/ChangeLog:

PR middle-end/112976
* tree-cfg.cc (verify_gimple_assign): Verify that
nontmporal moves are stores.
* gimple.h (struct gimple): Note that only
nontemporal stores are supported.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/gimple.h
gcc/tree-cfg.cc

index 8a8ca109bbff838d76e357a86b80390584b8189c..bd315ffc2dd41fbbfeaf3b21548abaf3d97763ae 100644 (file)
@@ -236,7 +236,8 @@ struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
      for clearing this bit before using it.  */
   unsigned int visited         : 1;
 
-  /* Nonzero if this tuple represents a non-temporal move.  */
+  /* Nonzero if this tuple represents a non-temporal move; currently
+     only stores are supported.  */
   unsigned int nontemporal_move        : 1;
 
   /* Pass local flags.  These flags are free for any pass to use as
index b1ba33018fd7edd2dfe547362a6f5b4d108a1fb8..1c5b7df8541edb0cd47d34b4253e2ba9b63c75d0 100644 (file)
@@ -4837,6 +4837,17 @@ verify_gimple_assign_single (gassign *stmt)
 static bool
 verify_gimple_assign (gassign *stmt)
 {
+  if (gimple_assign_nontemporal_move_p (stmt))
+    {
+      tree lhs = gimple_assign_lhs (stmt);
+      if (is_gimple_reg (lhs))
+       {
+         error ("nontemporal store's lhs cannot be a gimple register");
+         debug_generic_stmt (lhs);
+         return true;
+       }
+    }
+
   switch (gimple_assign_rhs_class (stmt))
     {
     case GIMPLE_SINGLE_RHS:
This page took 0.071684 seconds and 5 git commands to generate.