This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa][Bug optimization/12747] Scalar replacement ofaggregates (part 1)


On Thu, 2003-11-20 at 16:32, Diego Novillo wrote:

> void
> copy (BitVector & DEST, BitVector & SRC, unsigned I)
> {
>     DEST[I] = SRC[I];
> }
> 
> which after scalarization is optimized into
> 
> void copy(BitVector&, BitVector&, unsigned int) (DEST, SRC, I)
> {
>   <D1565>.m_bv = SRC;
>   <D1565>.m_idx = I;
> 
>   <D1561>.m_bv = <D1565>.m_bv;
>   <D1561>.m_idx = I;
>   <D1572>.m_bv = DEST;
>   <D1572>.m_idx = I;
> 
>   <D1560>.m_bv = <D1572>.m_bv;
>   <D1560>.m_idx = I;
>   T.3 = getBit (<D1561>.m_bv, I);
>   <D1587> = (int)T.3;
> 
>   setBit (<D1560>.m_bv, <D1560>.m_idx, (int)(bool)<D1587>);
> }
> 

Whats the SSA look like for this one? This is presumably final optimized
code. All the componentry is renamed via virtual operands?

> After I get TREE_ADDRESSABLE fixed for the remaining structures, we will
> get:
> 
> void copy(BitVector&, BitVector&, unsigned int) (DEST, SRC, I)
> {
>   T.3 = getBit (SRC, I);
>   <D1587> = (int)T.3;
>   setBit (DEST, I, (int)(bool)<D1587>);
> }
> 

I would think we'd get:

void copy(BitVector&, BitVector&, unsigned int) (DEST, SRC, I)
{
  setBit (DEST, I, (int)(bool)(int)getBit (SRC, I));
}

out the other end now... Although now that I think about it I dont think
I have enabled moving function calls, so I guess we'd get

void copy(BitVector&, BitVector&, unsigned int) (DEST, SRC, I)
{
  T.3 = getBit (SRC, I);
  setBit (DEST, I, (int)(bool)(int)T.3);
}

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]