public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How to enable DCE during late_ipa_passes?
@ 2023-09-18  7:16 Hanke Zhang
  2023-09-18  7:56 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Hanke Zhang @ 2023-09-18  7:16 UTC (permalink / raw)
  To: gcc

Hi, I am currently developing a new pass in the late_ipa_passes phase,
located behind the pass_ipa_pta and in front of the
pass_omp_simd_clone. I now hope that after the pass I developed, the
code can be vectorized, that is, the code that can be vectorized
during the pass_omp_simd_clone.

But not yet, I'm guessing that maybe it's because I added some dead
code during the pass I developed, so I want to be followed by a DCE
pass right after my pass, hoping that this will allow
pass_omp_simd_clone to vectorize the code after my pass.

But I've found that adding NEXT_PASS(pass_dce) directly after my pass
results in a runtime error, so I would like to ask if there is any
good way to get pass_dce to work in the late_ipa_passes phase?

Hanke Zhang.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to enable DCE during late_ipa_passes?
  2023-09-18  7:16 How to enable DCE during late_ipa_passes? Hanke Zhang
@ 2023-09-18  7:56 ` Richard Biener
  2023-09-18  8:08   ` Hanke Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2023-09-18  7:56 UTC (permalink / raw)
  To: Hanke Zhang; +Cc: gcc

On Mon, Sep 18, 2023 at 9:17 AM Hanke Zhang via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hi, I am currently developing a new pass in the late_ipa_passes phase,
> located behind the pass_ipa_pta and in front of the
> pass_omp_simd_clone. I now hope that after the pass I developed, the
> code can be vectorized, that is, the code that can be vectorized
> during the pass_omp_simd_clone.
>
> But not yet, I'm guessing that maybe it's because I added some dead
> code during the pass I developed, so I want to be followed by a DCE
> pass right after my pass, hoping that this will allow
> pass_omp_simd_clone to vectorize the code after my pass.
>
> But I've found that adding NEXT_PASS(pass_dce) directly after my pass
> results in a runtime error, so I would like to ask if there is any
> good way to get pass_dce to work in the late_ipa_passes phase?

You could try doing

  NEXT_PASS (pass_your_ipa_pass)
  PUSH_INSERT_PASSES_WITHIN (pass_your_ipa_pass)
    NEXT_PASS (pass_dce);
  POP_INSERT_PASES ()
  NEXT_PASS (pass_omp_simd_clone)


> Hanke Zhang.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to enable DCE during late_ipa_passes?
  2023-09-18  7:56 ` Richard Biener
@ 2023-09-18  8:08   ` Hanke Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Hanke Zhang @ 2023-09-18  8:08 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc

Thanks! That works!

Richard Biener <richard.guenther@gmail.com> 于2023年9月18日周一 15:56写道:
>
> On Mon, Sep 18, 2023 at 9:17 AM Hanke Zhang via Gcc <gcc@gcc.gnu.org> wrote:
> >
> > Hi, I am currently developing a new pass in the late_ipa_passes phase,
> > located behind the pass_ipa_pta and in front of the
> > pass_omp_simd_clone. I now hope that after the pass I developed, the
> > code can be vectorized, that is, the code that can be vectorized
> > during the pass_omp_simd_clone.
> >
> > But not yet, I'm guessing that maybe it's because I added some dead
> > code during the pass I developed, so I want to be followed by a DCE
> > pass right after my pass, hoping that this will allow
> > pass_omp_simd_clone to vectorize the code after my pass.
> >
> > But I've found that adding NEXT_PASS(pass_dce) directly after my pass
> > results in a runtime error, so I would like to ask if there is any
> > good way to get pass_dce to work in the late_ipa_passes phase?
>
> You could try doing
>
>   NEXT_PASS (pass_your_ipa_pass)
>   PUSH_INSERT_PASSES_WITHIN (pass_your_ipa_pass)
>     NEXT_PASS (pass_dce);
>   POP_INSERT_PASES ()
>   NEXT_PASS (pass_omp_simd_clone)
>
>
> > Hanke Zhang.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-18  8:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18  7:16 How to enable DCE during late_ipa_passes? Hanke Zhang
2023-09-18  7:56 ` Richard Biener
2023-09-18  8:08   ` Hanke Zhang

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