]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove PHI_RESULT_PTR and change some PHI_RESULT to be gimple_phi_result [PR116643]
authorAndrew Pinski <quic_apinski@quicinc.com>
Thu, 19 Sep 2024 23:32:50 +0000 (16:32 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Fri, 20 Sep 2024 05:02:37 +0000 (05:02 +0000)
There was only a few uses PHI_RESULT_PTR so lets remove it and use gimple_phi_result_ptr
or gimple_phi_result directly instead.
Since I was modifying ssa-iterators.h for the use of PHI_RESULT_PTR, change the use
of PHI_RESULT there to be gimple_phi_result instead.

This also removes one extra indirection that was done for PHI_RESULT so stage2 building
should be slightly faster.

Bootstrapped and tested on x86_64-linux-gnu.

PR middle-end/116643

gcc/ChangeLog:

* ssa-iterators.h (single_phi_def): Use gimple_phi_result
instead of PHI_RESULT.
(op_iter_init_phidef): Use gimple_phi_result/gimple_phi_result_ptr
instead of PHI_RESULT/PHI_RESULT_PTR.
* tree-ssa-operands.h (PHI_RESULT_PTR): Remove.
(PHI_RESULT): Use gimple_phi_result directly.
(SET_PHI_RESULT): Use gimple_phi_result_ptr directly.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/ssa-iterators.h
gcc/tree-ssa-operands.h

index b7b01fd018aff836a716e5c13073552997690121..e0e555cc4720039b0bc1ddcedd1306a50f534381 100644 (file)
@@ -768,7 +768,7 @@ num_ssa_operands (gimple *stmt, int flags)
 inline tree
 single_phi_def (gphi *stmt, int flags)
 {
-  tree def = PHI_RESULT (stmt);
+  tree def = gimple_phi_result (stmt);
   if ((flags & SSA_OP_DEF) && is_gimple_reg (def))
     return def;
   if ((flags & SSA_OP_VIRTUAL_DEFS) && !is_gimple_reg (def))
@@ -811,7 +811,7 @@ op_iter_init_phiuse (ssa_op_iter *ptr, gphi *phi, int flags)
 inline def_operand_p
 op_iter_init_phidef (ssa_op_iter *ptr, gphi *phi, int flags)
 {
-  tree phi_def = PHI_RESULT (phi);
+  tree phi_def = gimple_phi_result (phi);
   int comp;
 
   clear_and_done_ssa_iter (ptr);
@@ -833,7 +833,7 @@ op_iter_init_phidef (ssa_op_iter *ptr, gphi *phi, int flags)
   /* The first call to op_iter_next_def will terminate the iterator since
      all the fields are NULL.  Simply return the result here as the first and
      therefore only result.  */
-  return PHI_RESULT_PTR (phi);
+  return gimple_phi_result_ptr (phi);
 }
 
 /* Return true is IMM has reached the end of the immediate use stmt list.  */
index 8072932564ad7985862d872e54abf6a83a32db8c..b6534f18c6602e88a4d03fdac52404b343a329b2 100644 (file)
@@ -72,9 +72,8 @@ struct GTY(()) ssa_operands {
 #define USE_OP_PTR(OP)         (&((OP)->use_ptr))
 #define USE_OP(OP)             (USE_FROM_PTR (USE_OP_PTR (OP)))
 
-#define PHI_RESULT_PTR(PHI)    gimple_phi_result_ptr (PHI)
-#define PHI_RESULT(PHI)                DEF_FROM_PTR (PHI_RESULT_PTR (PHI))
-#define SET_PHI_RESULT(PHI, V) SET_DEF (PHI_RESULT_PTR (PHI), (V))
+#define PHI_RESULT(PHI)                gimple_phi_result (PHI)
+#define SET_PHI_RESULT(PHI, V) SET_DEF (gimple_phi_result_ptr (PHI), (V))
 /*
 #define PHI_ARG_DEF(PHI, I)    USE_FROM_PTR (PHI_ARG_DEF_PTR ((PHI), (I)))
 */