public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5077] RISC-V: Fix bug of AVL propagation PASS
@ 2023-11-02 11:44 Pan Li
  0 siblings, 0 replies; only message in thread
From: Pan Li @ 2023-11-02 11:44 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f6284ef38701920865de3c9e18bb3f6068fde4d1

commit r14-5077-gf6284ef38701920865de3c9e18bb3f6068fde4d1
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Thu Nov 2 19:30:23 2023 +0800

    RISC-V: Fix bug of AVL propagation PASS
    
    A run FAIL suddenly shows up today to me:
    FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_run-11.c execution test
    
    that I didn't have before.
    
    After investigation, I realize that there is a bug in AVL propagtion PASS.
    
    gcc/ChangeLog:
    
            * config/riscv/riscv-avlprop.cc
            (pass_avlprop::get_vlmax_ta_preferred_avl): Don't allow
            non-real insn AVL propation.

Diff:
---
 gcc/config/riscv/riscv-avlprop.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/config/riscv/riscv-avlprop.cc b/gcc/config/riscv/riscv-avlprop.cc
index c59eb7f6fa32..bcd77a3047a0 100644
--- a/gcc/config/riscv/riscv-avlprop.cc
+++ b/gcc/config/riscv/riscv-avlprop.cc
@@ -266,6 +266,13 @@ pass_avlprop::get_vlmax_ta_preferred_avl (insn_info *insn) const
 	      def_info *def2 = dl.prev_def (use_insn);
 	      if (!def1 || !def2 || def1 != def2)
 		return NULL_RTX;
+	      /* For vectorized codes, we always use SELECT_VL/MIN_EXPR to
+		 calculate the loop len at the header of the loop.
+		 We only allow AVL propagation for real instruction for now.
+		 TODO: We may enhance it for intrinsic codes if it is necessary.
+	      */
+	      if (!def1->insn ()->is_real ())
+		return NULL_RTX;
 
 	      /* FIXME: We only all AVL propation within a block which should
 		 be totally enough for vectorized codes.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-02 11:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 11:44 [gcc r14-5077] RISC-V: Fix bug of AVL propagation PASS Pan Li

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