[DAGCombiner] Use getTokenFactor in a few more cases.

SDNodes can only have 64k operands and for some inputs (e.g. large
number of stores), we can reach this limit when creating TokenFactor
nodes. This patch is a follow up to D56740 and updates a few more places
that potentially can create TokenFactors with too many operands.

Reviewers: efriedma, craig.topper, aemerson, RKSimon

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D59156

llvm-svn: 356668
This commit is contained in:
Florian Hahn 2019-03-21 14:32:09 +00:00
parent da4992bf8d
commit 71033f2987
1 changed files with 4 additions and 4 deletions

View File

@ -1865,9 +1865,9 @@ SDValue DAGCombiner::visitTokenFactor(SDNode *N) {
if (SeenChains.count(Op.getNode()) == 0)
PrunedOps.push_back(Op);
}
Result = DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, PrunedOps);
Result = DAG.getTokenFactor(SDLoc(N), PrunedOps);
} else {
Result = DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, Ops);
Result = DAG.getTokenFactor(SDLoc(N), Ops);
}
}
return Result;
@ -14431,7 +14431,7 @@ SDValue DAGCombiner::getMergeStoreChains(SmallVectorImpl<MemOpLink> &StoreNodes,
}
assert(Chains.size() > 0 && "Chain should have generated a chain");
return DAG.getNode(ISD::TokenFactor, StoreDL, MVT::Other, Chains);
return DAG.getTokenFactor(StoreDL, Chains);
}
bool DAGCombiner::MergeStoresOfConstantsOrVecElts(
@ -19600,7 +19600,7 @@ SDValue DAGCombiner::FindBetterChain(LSBaseSDNode *N, SDValue OldChain) {
return Aliases[0];
// Construct a custom tailored token factor.
return DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, Aliases);
return DAG.getTokenFactor(SDLoc(N), Aliases);
}
namespace {