On Tue, Jul 6, 2021 at 7:31 AM Segher Boessenkool
<seg...@kernel.crashing.org> wrote:
>
> Hi!
>
> I ran into this in shrink-wrap.c today.
>
> On Thu, Jun 03, 2021 at 02:54:07PM +0800, liuhongt via Gcc-patches wrote:
> > Use "used" flag for CALL_INSN to indicate it's a fake call. If it's a
> > fake call, it won't have its own function stack.
>
> Could you document somewhere what a "fake call" *is*?  Including what
> that means to RTL, how this is expected to be used, etc.?  In rtl.h is
fake call is used for TARGET_INSN_CALLEE_ABI, i'll add comments for
#define FAKE_CALL_P(RTX) in rtl.h
> fine with me, but as it is, no one can know when to use this.  What does
> "its own function stack" mean in the description here?  You can only put
> FAKE_CALL on functions that do not have a stack frame?  But that is
> never true on x86, so that cannot be it, unless there isn't a call
> instruction at all?  But then, why use an RTL call insn for this?
>
> Other targets simply do not use an RTL "call" when they want to hide
> such an instruction, why can't you do that here, wouldn't that work much
> better?  There are many more insns that you may want to hide.  The
> traditional solution is to use unspecs, which very directly hides all
> details.

It's explained here,
> >> Yeah.  Initially clobber_high seemed like the best appraoch for
> >> handling the tlsdesc thing, but in practice it was too difficult
> >> to shoe-horn the concept in after the fact, when so much rtl
> >> infrastructure wasn't prepared to deal with it.  The old support
> >> didn't handle all cases and passes correctly, and handled others
> >> suboptimally.
> >>
> >> I think it would be worth using the same approach as
> >> https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg01466.html for
> >> vzeroupper: represent the instructions as call_insns in which the
> >> call has a special vzeroupper ABI.  I think that's likely to lead
> >> to better code than clobber_high would (or at least, it did for tlsdesc).

refer to [1] for more details
[1] https://gcc.gnu.org/pipermail/gcc-patches/2021-May/570265.html
>
>
> Segher



-- 
BR,
Hongtao

Reply via email to