[PATCH] D13220: Optimize DeadCodeEliminationPass

escha via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 10:40:38 PDT 2015


escha added inline comments.

================
Comment at: lib/Transforms/Scalar/DCE.cpp:102
@@ +101,3 @@
+    // dead as we go.
+    for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
+      Value *OpV = I->getOperand(i);
----------------
sanjoy wrote:
> I think this can be a range for loop, like
> 
> ```
> for (Use &Op : I->uses()) {
>   ...
> ```
Is this a good idea? It feels iterating over the operands is a bit iffy given that we're modifying the operand list as we go.


Repository:
  rL LLVM

http://reviews.llvm.org/D13220





More information about the llvm-commits mailing list