[LLVMdev] PrescheduleNodesWithMultipleUses() causing failure in PickNodeToScheduleBottomUp() ???

Robert Lytton robert at xmos.com
Tue Aug 20 14:57:20 PDT 2013


Hi,

I have an assert firing due to PickNodeToScheduleBottomUp():
    1. having a CallResource in use pushing an interference of current SUnit.
    2. having no more SUnits in the  AvailableQueue
    3. The only interference being the SUnit that just failed due to a Call Resource.
    4. An attempt to duplicate this node which has the 'Call Resource' as a physical register.
Thus the call to getMinimalPhysRegClass() asserts - Call Resource is not in a class!
..../lib/CodeGen/TargetRegisterInfo.cpp:120: const llvm::TargetRegisterClass* llvm::TargetRegisterInfo::getMinimalPhysRegClass(unsigned int, llvm::EVT) const: Assertion `BestRC && "Couldn't find the register class"' failed.


The interesting thing about this failure is that the Predecessor/Successor of two nodes was changed by PrescheduleNodesWithMultipleUses().
If they were not, the AvailableQueue would have had nodes, and all would have been fine.
I am quite uneasy over how PrescheduleNodesWithMultipleUses() has changed the Predecessor/Successor.
It seems to have changed the DAG into something impossible to schedule - I need to look more carefully to confirm this.


I'm not sure if this is one problem or two - or a target problem passing something dangerous to the scheduler.
Any help would be most welcome.


I have attached the code to exercise the bug - the slightest of perturbation will make it compile fine  e.g. add an extra 'undef' argument to f2 viz:  double @f2(i32, double, double, double).
This example only fails for xcore targets.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130820/f1f42402/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.ll
Type: application/octet-stream
Size: 394 bytes
Desc: bug.ll
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130820/f1f42402/attachment.obj>


More information about the llvm-dev mailing list