[PATCH] D71093: [InstCombine] Insert instructions before adding them to worklist

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 10:42:58 PST 2019


kuhar marked an inline comment as done.
kuhar added inline comments.


================
Comment at: llvm/include/llvm/Transforms/InstCombine/InstCombineWorklist.h:95-96
+      auto *UI = cast<Instruction>(U);
+      // Do not add instructions that haven't been properly inserted yet.
+      if (UI->getParent()) {
+        Add(UI);
----------------
lebedev.ri wrote:
> The described behavior sounds like a bug to me.
> More importantly, it's not related to the printing changes?
The users that I refer to here are new instructions that are being constructed; InstCombine inserts them in subsequent calls to `Add()`. This happens in a few places and it's not obvious to me make it more straight-forward.
With the changes to the worklist here, everything works like before and the order of iteration is exactly the same.

Let me know if you want me to dig up some concrete examples for this behavior here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71093/new/

https://reviews.llvm.org/D71093





More information about the llvm-commits mailing list