[LLVMdev] Problem with isMoveInstr

Vladimir Prus ghost at cs.msu.su
Thu Jul 1 09:28:01 PDT 2004


I've tried to implement the isMoveInstr method from TargetInstrInfo class, and 
the register allocator immediately started to crash, in:

#4  0x40e88787 in llvm::LiveIntervals::joinIntervals (this=0x80630b0)
    at ../lib/CodeGen/LiveIntervals.cpp:493
493                     assert(r2iA != r2iMap_.end());

The instruction it crashes is:

(gdb) p $4.dump()
  %reg1056 = move %gr7

And gr7 is exactly the register which is looked up with

   Reg2IntervalMap::iterator r2iA = r2iMap_.find(regA)

on line 492. I'm not sure the about the logic, but seems the code tries to map 
register into live interval, and since the above gr7 is inserted by code 
selector (it's return value from a function), it's not wonder no interval is 
found.

I've worked this around by making isMoveInstr return false when either of 
operands is physical register, but looks like this defeats the purpose of 
isMoveInstr. What kind of information I can further provide to help diagnose 
the problem?

Thanks,
Volodya




More information about the llvm-dev mailing list