diff mbox series

RISC-V: Reorder VSETVL PASS location

Message ID 20230118030347.68061-1-juzhe.zhong@rivai.ai
State New
Headers show
Series RISC-V: Reorder VSETVL PASS location | expand

Commit Message

juzhe.zhong@rivai.ai Jan. 18, 2023, 3:03 a.m. UTC
From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>

gcc/ChangeLog:

        * config/riscv/riscv-passes.def (INSERT_PASS_BEFORE): Reorder VSETVL PASS.

---
 gcc/config/riscv/riscv-passes.def | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Law Jan. 22, 2023, 7:36 p.m. UTC | #1
On 1/17/23 20:03, juzhe.zhong@rivai.ai wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> 
> gcc/ChangeLog:
> 
>          * config/riscv/riscv-passes.def (INSERT_PASS_BEFORE): Reorder VSETVL PASS.
It'd be useful to know the motivation here, I could easily see someone 
in the future finding a case where the location of the vsetvl gets 
influenced by some dead code that would have been removed by the DCE 
pass.  Then they're going to want to know the motivation behind the 
current pass placement.

So, OK after adding a comment describing why the pass is placed where it is.

Jeff
Kito Cheng Jan. 27, 2023, 9:40 a.m. UTC | #2
Added more comments and committed, thanks!

On Mon, Jan 23, 2023 at 3:36 AM Jeff Law <jeffreyalaw@gmail.com> wrote:

>
>
> On 1/17/23 20:03, juzhe.zhong@rivai.ai wrote:
> > From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> >
> > gcc/ChangeLog:
> >
> >          * config/riscv/riscv-passes.def (INSERT_PASS_BEFORE): Reorder
> VSETVL PASS.
> It'd be useful to know the motivation here, I could easily see someone
> in the future finding a case where the location of the vsetvl gets
> influenced by some dead code that would have been removed by the DCE
> pass.  Then they're going to want to know the motivation behind the
> current pass placement.
>
> So, OK after adding a comment describing why the pass is placed where it
> is.
>
> Jeff
>
diff mbox series

Patch

diff --git a/gcc/config/riscv/riscv-passes.def b/gcc/config/riscv/riscv-passes.def
index d2d48f231aa..614b767dc8a 100644
--- a/gcc/config/riscv/riscv-passes.def
+++ b/gcc/config/riscv/riscv-passes.def
@@ -18,4 +18,4 @@ 
    <http://www.gnu.org/licenses/>.  */
 
 INSERT_PASS_AFTER (pass_rtl_store_motion, 1, pass_shorten_memrefs);
-INSERT_PASS_BEFORE (pass_sched2, 1, pass_vsetvl);
+INSERT_PASS_BEFORE (pass_fast_rtl_dce, 1, pass_vsetvl);