Ok, i'm having a problem with understanding the allocating of registers. I've written in the "addPassesToEmitAssembly()" the passes to create the assembly code, as in the PowerPC example. I'ved tried filling up as much of the code in <Target>RegisterInfo.cpp (Register/Frame code) to handle writing and reading from stack.
The allocation method I used was -regalloc=simple, so it only wrote to 2 or 3 registers total, with a lot of loading and writing to stack.
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.
Is there any passes that need to occur to correct this error? For the passes in emitting assembly I have this:
The backend target I'm writing is to a subset of MIPS32, so I borrowed some amount of code from PowerPC.
Thanks for any help.