[PATCH] D41943: [LoopDeletion] Handle users in unreachable block

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 03:33:39 PST 2018


skatkov added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1370
+      auto *Undef = UndefValue::get(I.getType());
+      for (Value::use_iterator UI = I.use_begin(), E = I.use_end(); UI != E;) {
+        Use &U = *UI;
----------------
lebedev.ri wrote:
> I think this can be simplified down to
> ```
> for (Use &U : I.uses())
> ```
I'm not sure I can do it due to I modify Use in a loop.
I implemented it in this way to be similar to how Value::replace** routines do it.


https://reviews.llvm.org/D41943





More information about the llvm-commits mailing list