mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
ISelDAG: spot chain cycles involving MachineNodes
Previously, the DAGISel function WalkChainUsers was spotting that it had entered already-selected territory by whether a node was a MachineNode (amongst other things). Since it's fairly common practice to insert MachineNodes during ISelLowering, this was not the correct check. Looking around, it seems that other nodes get their NodeId set to -1 upon selection, so this makes sure the same thing happens to all MachineNodes and uses that characteristic to determine whether we should stop looking for a loop during selection. This should fix PR15840. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191165 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1857,15 +1857,15 @@ WalkChainUsers(const SDNode *ChainedNode,
|
||||
|
||||
SDNode *User = *UI;
|
||||
|
||||
if (User->getOpcode() == ISD::HANDLENODE) // Root of the graph.
|
||||
continue;
|
||||
|
||||
// If we see an already-selected machine node, then we've gone beyond the
|
||||
// pattern that we're selecting down into the already selected chunk of the
|
||||
// DAG.
|
||||
if (User->isMachineOpcode() ||
|
||||
User->getOpcode() == ISD::HANDLENODE) // Root of the graph.
|
||||
continue;
|
||||
|
||||
unsigned UserOpcode = User->getOpcode();
|
||||
if (UserOpcode == ISD::CopyToReg ||
|
||||
if (User->isMachineOpcode() ||
|
||||
UserOpcode == ISD::CopyToReg ||
|
||||
UserOpcode == ISD::CopyFromReg ||
|
||||
UserOpcode == ISD::INLINEASM ||
|
||||
UserOpcode == ISD::EH_LABEL ||
|
||||
|
Reference in New Issue
Block a user