x86 self-compile

Matthew Fluet fluet@CS.Cornell.EDU
Wed, 2 Aug 2000 17:00:50 -0400 (EDT)


> > I'd have thought that instruction selection
> > and general code-generation issues would have dominated.  
> > Have you
> > guys had a chance to look at the assembly output to eyeball 
> > code-generation/instruction selection quality?
> 
> I haven't.

I've looked through it some.  I think it looks o.k.  There are some
reg-reg moves that might be eliminated with some peephole optimizations;
although the right place for those might be back up at the machine IL to
eliminate something like  RI(0) = Int_add(SI(4), 1)
                          SP(8) = RI(0)
But I think we could do it at the assembly level too.

I think the worst code-gen right now is for a branch.

RI(0) = Int_lt(SI(4), SI(8))
BZ(RI(0), L_1)

get's turned into a comparison, a set on condition, a test, a conditional
jump, and an unconditional jump.  With the liveness and some peephole
optimizations, we should get that down to a comparision followed by a
conditional jump and either a fall through or an unconditional jump.