From 2fe568c95e387f350ae7713f27b291e7e793087d Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 16 Feb 2017 15:11:49 +0000 Subject: [PATCH] [X86] Remove local areOnlyUsersOf helper and use SDNode::areOnlyUsersOf instead. llvm-svn: 295326 --- llvm/lib/Target/X86/X86ISelLowering.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 3edfc98635a5..0ee09110a5ed 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -14127,14 +14127,6 @@ static SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, const X86Subtarget &Subtarget, return Op; } -static bool areOnlyUsersOf(SDNode *N, ArrayRef ValidUsers) { - for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) - if (llvm::all_of(ValidUsers, - [&I](SDValue V) { return V.getNode() != *I; })) - return false; - return true; -} - // Lower a node with an INSERT_SUBVECTOR opcode. This may result in a // simple superregister reference or explicit instructions to insert // the upper bits of a vector. @@ -34291,7 +34283,7 @@ static SDValue combineInsertSubvector(SDNode *N, SelectionDAG &DAG, // lower to a VBROADCASTF128/VBROADCASTI128/etc. if (auto *Ld = dyn_cast(peekThroughOneUseBitcasts(SubVec2))) { if (SubVec2 == SubVec && ISD::isNormalLoad(Ld) && - areOnlyUsersOf(SubVec2.getNode(), {SDValue(N, 0), Vec})) { + SDNode::areOnlyUsersOf({N, Vec.getNode()}, SubVec2.getNode())) { return DAG.getNode(X86ISD::SUBV_BROADCAST, dl, OpVT, SubVec); } }