[LLVMdev] Register Allocation problem

Misha Brukman brukman at uiuc.edu
Mon May 16 19:00:21 PDT 2005


On Mon, May 16, 2005 at 05:15:30PM -0700, John Cortes wrote:
> If I use any of the regalloc parameters (local, ...) I get an error in
> the LiveVariable.cpp file, in the part that I think cheaks for dead
> code because a Variable didn't have a defined Instance to a Machine
> instruction.
> 
> " llc: LiveVariables.cpp:86: void
> llvm::LiveVariables::HandleVirtRegUse(llvm::LiveVariables::VarInfo&,
> llvm::MachineBasicBlock*, llvm::MachineInstr*): Assertion
> `VRInfo.DefInst && "Register use before def!"' failed.

This is a bug in your instruction selector and the assertion is telling
you exactly what's wrong.  Registers in MachineInstrs are also in SSA --
there must be a single static def of any register before its use.

To help you narrow down the bug to a small test case, you can use
bugpoint:

http://llvm.cs.uiuc.edu/docs/HowToSubmitABug.html#codegen

That should catch crashes in llc and give you a tiny test case to work
with.  If that doesn't help, let us know.

-- 
Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu




More information about the llvm-dev mailing list