[LLVMdev] Heads up: Local register allocator going away

Kalle.Raiskila at nokia.com Kalle.Raiskila at nokia.com
Fri Jun 4 01:57:36 PDT 2010


On Thu, 2010-06-03 at 02:53 +0200, Jakob Stoklund Olesen wrote:
> If you are using the local register allocator, please try switching to the fast allocator and report any bugs you find.
> 

Tried it, and it seems to break quite a big chunk of our tests on SPU :)

Before r103488 ("Mostly rewrite RegAllocFast") there was no problem.

But with r103488, I get a:
llvm/lib/CodeGen/RegisterScavenging.cpp:196: void
llvm::RegScavenger::forward(): Assertion `SubUsed && "Using an undefined
register!"' failed.

In r103685 ("More asserts around physreg uses") the error changed to:
llvm/lib/CodeGen/RegAllocFast.cpp:629:
void<unnamed>::RAFast::AllocateBasicBlock(llvm::MachineBasicBlock&):
Assertion `PhysRegState[Reg] <= regReserved && "Using clobbered
physreg"' failed.

And with latest it is now:
Instruction uses an allocated register
UNREACHABLE executed
at /home/kraiskil/llvm/svn-clean/llvm/lib/CodeGen/RegAllocFast.cpp:302!

This is probably in the SPU backend, as all (most) other backends
compile the example just fine? Where do I start to look if I want to fix
this? I can file a PR if this is not in the SPU backend.


kalle

P.s. This is a simplification of programs that crash:

declare [8 x [8 x float]]* @extFunc()
define void @testFunc() {
  %sl8_5 = tail call [8 x [8 x float]]* @extFunc() 
  br label %Entry
Entry:                       
  %idx = phi i64 [ 0, %0 ], [ %next, %Entry ] 
  %scevgep = getelementptr [8 x [8 x float]]* %sl8_5, i64 0, i64 %idx,
i64 0 
  %next = add i64 %idx, 1           
  %exitcond = icmp eq i64 %next, 8       
  br i1 %exitcond, label %Exit, label %Entry
Exit:                                  
  ret void
}
(Sorry for the cluttered simpification: removing any of the call,
getelementpointer or loop removes the llc crash)







More information about the llvm-dev mailing list