* [PATCH] RISC-V: Fix bug of AVL propagation PASS
@ 2023-11-02 11:30 Juzhe-Zhong
2023-11-02 11:34 ` Robin Dapp
0 siblings, 1 reply; 3+ messages in thread
From: Juzhe-Zhong @ 2023-11-02 11:30 UTC (permalink / raw)
To: gcc-patches; +Cc: kito.cheng, kito.cheng, jeffreyalaw, rdapp.gcc, Juzhe-Zhong
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.
---
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 bec1e3c715a..1dfaa8742da 100644
--- a/gcc/config/riscv/riscv-avlprop.cc
+++ b/gcc/config/riscv/riscv-avlprop.cc
@@ -308,6 +308,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.
--
2.36.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RISC-V: Fix bug of AVL propagation PASS
2023-11-02 11:30 [PATCH] RISC-V: Fix bug of AVL propagation PASS Juzhe-Zhong
@ 2023-11-02 11:34 ` Robin Dapp
2023-11-02 11:44 ` Li, Pan2
0 siblings, 1 reply; 3+ messages in thread
From: Robin Dapp @ 2023-11-02 11:34 UTC (permalink / raw)
To: Juzhe-Zhong, gcc-patches; +Cc: rdapp.gcc, kito.cheng, kito.cheng, jeffreyalaw
LGTM.
Regards
Robin
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] RISC-V: Fix bug of AVL propagation PASS
2023-11-02 11:34 ` Robin Dapp
@ 2023-11-02 11:44 ` Li, Pan2
0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2023-11-02 11:44 UTC (permalink / raw)
To: Robin Dapp, Juzhe-Zhong, gcc-patches; +Cc: kito.cheng, kito.cheng, jeffreyalaw
Committed, thanks Robin.
Pan
-----Original Message-----
From: Robin Dapp <rdapp.gcc@gmail.com>
Sent: Thursday, November 2, 2023 7:34 PM
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>; gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com; kito.cheng@gmail.com; kito.cheng@sifive.com; jeffreyalaw@gmail.com
Subject: Re: [PATCH] RISC-V: Fix bug of AVL propagation PASS
LGTM.
Regards
Robin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-02 11:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 11:30 [PATCH] RISC-V: Fix bug of AVL propagation PASS Juzhe-Zhong
2023-11-02 11:34 ` Robin Dapp
2023-11-02 11:44 ` Li, Pan2
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).