summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-05-12 20:05:31 +0000
committerPete Cooper <peter_cooper@apple.com>2015-05-12 20:05:31 +0000
commit833f34d837eca1e11370fbdea0bcbae10fee70b7 (patch)
tree715708db84c3689da9353f39f85088f86359bbe1 /llvm/lib/Transforms/Scalar
parent26b7aa020bdcabd10ba1c81226327007321aeb89 (diff)
downloadbcm5719-llvm-833f34d837eca1e11370fbdea0bcbae10fee70b7.tar.gz
bcm5719-llvm-833f34d837eca1e11370fbdea0bcbae10fee70b7.zip
Convert PHI getIncomingValue() to foreach over incoming_values(). NFC.
We already had a method to iterate over all the incoming values of a PHI. This just changes all eligible code to use it. Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB. llvm-svn: 237169
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index b692866f54a..ca1918ef83d 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -491,8 +491,8 @@ bool canSinkOrHoistInst(Instruction &I, AliasAnalysis *AA, DominatorTree *DT,
/// This pattern occurs most often with LCSSA PHI nodes.
///
static bool isTriviallyReplacablePHI(const PHINode &PN, const Instruction &I) {
- for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
- if (PN.getIncomingValue(i) != &I)
+ for (const Value *IncValue : PN.incoming_values())
+ if (IncValue != &I)
return false;
return true;
OpenPOWER on IntegriCloud