[PATCH] D13063: Faster SimplifyInstructionsInBlock

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 16:39:24 PDT 2015

reames added inline comments.

Comment at: lib/Transforms/Utils/Local.cpp:461
@@ +460,3 @@
+    I->eraseFromParent();
+    return true;
+  }
I don't know.  If the assert doesn't fail, it clearly wasn't tested or used.

Comment at: lib/Transforms/Utils/Local.cpp:495
@@ +494,3 @@
+    // worklist from an earlier visit.
+    WorkList.remove(I);
+    MadeChange |= simplifyAndDCEInstruction(I, WorkList, DL, TLI);
Why would removing from a SmallSetVector be fast?  It appears to be doing an erase on the underlying vector which is needed to preserve order.

Does simply skipping the instruction if it's already in the worklist work?  That should be pretty fast.  



More information about the llvm-commits mailing list