From 71033f29873626604787002972c1609295619616 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 21 Mar 2019 14:32:09 +0000 Subject: [PATCH] [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 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 093da6f..5d7ed8a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -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 &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 { -- 2.7.4