[PATCH] D124764: [NFC][GVNSink] Don't pretend that iteration is over instructions when it's actually over blocks
Dawid Jurczak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 2 05:34:59 PDT 2022
yurai007 created this revision.
yurai007 added reviewers: jmolloy, jeroen.dobbelaere, jnspaulsson, nikic, lebedev.ri, xbolva00.
Herald added a subscriber: hiraditya.
Herald added a project: All.
yurai007 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D124764
Files:
llvm/lib/Transforms/Scalar/GVNSink.cpp
Index: llvm/lib/Transforms/Scalar/GVNSink.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/GVNSink.cpp
+++ llvm/lib/Transforms/Scalar/GVNSink.cpp
@@ -779,11 +779,11 @@
unsigned NumOrigPreds = Preds.size();
// We can only sink instructions through unconditional branches.
- for (auto I = Preds.begin(); I != Preds.end();) {
- if ((*I)->getTerminator()->getNumSuccessors() != 1)
- I = Preds.erase(I);
+ for (auto BB = Preds.begin(); BB != Preds.end();) {
+ if ((*BB)->getTerminator()->getNumSuccessors() != 1)
+ BB = Preds.erase(BB);
else
- ++I;
+ ++BB;
}
LockstepReverseIterator LRI(Preds);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124764.426383.patch
Type: text/x-patch
Size: 693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220502/f6d8a7d9/attachment.bin>
More information about the llvm-commits
mailing list