Re: [PATCH 4/8] cfg: adjust phi-sources when merging BBs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 16, 2020 at 02:53:21PM -0800, Linus Torvalds wrote:
> On Mon, Nov 16, 2020 at 2:30 PM Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
> >
> > +static void adjust_phisrc(struct basic_block *top, struct instruction *insn)
> 
> My only issue is that this is a really odd name, and calling convention.
> 
> "adjust"?
> 
> Wouldn't it be more sensible to call this "remove_phisrc()", because
> that's what it does. It removes the matching phisrc instruction in the
> specified basic block.

Yes, the name is horrible and doesn't mean much. I'll change it.
 
> (I also think it might be a bit more obvious to do the get_phinode()
> in the caller, and simply pass in the OP_PHI instruction, but maybe
> you had reasons to do it that way).

In fact, I wrote it first like that but then I've another piece
of code that need exactly the same info so I change it into
a separate function.

This code is a bit weird though, because it actively use the fact
that each phi-sources feeds a single phi-node while the underlying
data structures are designed so that phi-sources can be shared
between phi-nodes (but I think that allowing them the be effectively
shared would bring too much problems).

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux