diff options
Diffstat (limited to 'lib/Transforms/Scalar/GVNSink.cpp')
-rw-r--r-- | lib/Transforms/Scalar/GVNSink.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/GVNSink.cpp b/lib/Transforms/Scalar/GVNSink.cpp index bf92e43c4715..5594c29bbd9f 100644 --- a/lib/Transforms/Scalar/GVNSink.cpp +++ b/lib/Transforms/Scalar/GVNSink.cpp @@ -592,12 +592,8 @@ private: /// Create a ModelledPHI for each PHI in BB, adding to PHIs. void analyzeInitialPHIs(BasicBlock *BB, ModelledPHISet &PHIs, SmallPtrSetImpl<Value *> &PHIContents) { - for (auto &I : *BB) { - auto *PN = dyn_cast<PHINode>(&I); - if (!PN) - return; - - auto MPHI = ModelledPHI(PN); + for (PHINode &PN : BB->phis()) { + auto MPHI = ModelledPHI(&PN); PHIs.insert(MPHI); for (auto *V : MPHI.getValues()) PHIContents.insert(V); |