Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,701 Lines • ▼ Show 20 Lines | if (N->getNumOperands() == 2) { | ||||
if (getInputChainForNode(N->getOperand(1).getNode()) == N->getOperand(0)) | if (getInputChainForNode(N->getOperand(1).getNode()) == N->getOperand(0)) | ||||
return N->getOperand(1); | return N->getOperand(1); | ||||
} | } | ||||
// Don't simplify token factors if optnone. | // Don't simplify token factors if optnone. | ||||
if (OptLevel == CodeGenOpt::None) | if (OptLevel == CodeGenOpt::None) | ||||
return SDValue(); | return SDValue(); | ||||
// If this is used only a single token factor, we should make sure we have a | |||||
courbet: "If the sole user of this node is a token factor, we should ..." | |||||
// chance to merge them together. This prevents TF chains from inhibiting | |||||
// optimizations. | |||||
if (N->hasOneUse() && N->use_begin()->getOpcode() == ISD::TokenFactor) | |||||
AddToWorklist(*(N->use_begin())); | |||||
SmallVector<SDNode *, 8> TFs; // List of token factors to visit. | SmallVector<SDNode *, 8> TFs; // List of token factors to visit. | ||||
SmallVector<SDValue, 8> Ops; // Ops for replacing token factor. | SmallVector<SDValue, 8> Ops; // Ops for replacing token factor. | ||||
SmallPtrSet<SDNode*, 16> SeenOps; | SmallPtrSet<SDNode*, 16> SeenOps; | ||||
bool Changed = false; // If we should replace this token factor. | bool Changed = false; // If we should replace this token factor. | ||||
// Start out with this token factor. | // Start out with this token factor. | ||||
TFs.push_back(N); | TFs.push_back(N); | ||||
▲ Show 20 Lines • Show All 17,942 Lines • Show Last 20 Lines |
"If the sole user of this node is a token factor, we should ..."