[LLVMdev] BranchInst problem

Chris Lattner sabre at nondot.org
Wed Jun 9 00:54:01 PDT 2004


On Wed, 9 Jun 2004, Vladimir Prus wrote:
> > I assume that the two unconditional gotos are just test code, right?  If
> > not, the second one is dead.
>
> Yes, in the final form there will be "iflt" instruction before the first goto,
> making it conditional.

Ah, ok :)

> > > The code after "goto" is disturbing. It looks like spill code, but it's
> > > not going to be ever executed. Any ideas why it's generated? Is there any
> > > additional information I should provide?
> >
> > Yup, just add the "isTerminator" bit on your gotos in your tablegen
> > description for the instruction.  This informs the code generator that any
> > spill code has to go above the instructions.
>
> Thanks, this works! I don't yet understand why spill code is needed there at
> all, but I'll return to that when I have branches working correctly.

I'm not sure either.  Can you send the code before and after register
allocation?  You might also try -regalloc=linearscan, as the default
allocator is, uhhh, non-optimal.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list