[llvm] r294337 - [x86] use range-for loops; NFCI
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 11:18:26 PST 2017
Author: spatel
Date: Tue Feb 7 13:18:25 2017
New Revision: 294337
URL: http://llvm.org/viewvc/llvm-project?rev=294337&view=rev
Log:
[x86] use range-for loops; NFCI
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=294337&r1=294336&r2=294337&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Feb 7 13:18:25 2017
@@ -29530,21 +29530,19 @@ static SDValue combineSelect(SDNode *N,
// Check all uses of that condition operand to check whether it will be
// consumed by non-BLEND instructions, which may depend on all bits are
// set properly.
- for (SDNode::use_iterator I = Cond->use_begin(), E = Cond->use_end();
- I != E; ++I)
- if (I->getOpcode() != ISD::VSELECT)
+ for (SDNode *U : Cond->uses())
+ if (U->getOpcode() != ISD::VSELECT)
// TODO: Add other opcodes eventually lowered into BLEND.
return SDValue();
// Update all the users of the condition, before committing the change,
// so that the VSELECT optimizations that expect the correct vector
// boolean value will not be triggered.
- for (SDNode::use_iterator I = Cond->use_begin(), E = Cond->use_end();
- I != E; ++I)
+ for (SDNode *U : Cond->uses())
DAG.ReplaceAllUsesOfValueWith(
- SDValue(*I, 0),
- DAG.getNode(X86ISD::SHRUNKBLEND, SDLoc(*I), I->getValueType(0),
- Cond, I->getOperand(1), I->getOperand(2)));
+ SDValue(U, 0),
+ DAG.getNode(X86ISD::SHRUNKBLEND, SDLoc(U), U->getValueType(0),
+ Cond, U->getOperand(1), U->getOperand(2)));
DCI.CommitTargetLoweringOpt(TLO);
return SDValue();
}
More information about the llvm-commits
mailing list