Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 5,931 Lines • ▼ Show 20 Lines | for (SDNode::use_iterator UI = N->use_begin(), UE = N->use_end(); | ||||
UI != UE; ++UI) { | UI != UE; ++UI) { | ||||
SDNode *User = *UI; | SDNode *User = *UI; | ||||
if (!User->isMachineOpcode()) | if (!User->isMachineOpcode()) | ||||
return false; | return false; | ||||
if (User->getMachineOpcode() != PPC::SELECT_I4 && | if (User->getMachineOpcode() != PPC::SELECT_I4 && | ||||
User->getMachineOpcode() != PPC::SELECT_I8) | User->getMachineOpcode() != PPC::SELECT_I8) | ||||
return false; | return false; | ||||
SDNode *Op1 = User->getOperand(1).getNode(); | |||||
SDNode *Op2 = User->getOperand(2).getNode(); | SDNode *Op2 = User->getOperand(2).getNode(); | ||||
// If we have a degenerate select with two equal operands, swapping will | |||||
// not do anything, and we may run into an infinite loop. | |||||
if (Op1 == Op2) | |||||
return false; | |||||
if (!Op2->isMachineOpcode()) | if (!Op2->isMachineOpcode()) | ||||
return false; | return false; | ||||
if (Op2->getMachineOpcode() != PPC::LI && | if (Op2->getMachineOpcode() != PPC::LI && | ||||
Op2->getMachineOpcode() != PPC::LI8) | Op2->getMachineOpcode() != PPC::LI8) | ||||
return false; | return false; | ||||
ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op2->getOperand(0)); | ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op2->getOperand(0)); | ||||
▲ Show 20 Lines • Show All 991 Lines • Show Last 20 Lines |