[PATCH] D159123: [CodeGen] Properly update insertion point of the builder

Igor Kirillov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 08:21:48 PDT 2023


igor.kirillov added inline comments.


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:1955
                               {Node->Real, Node->Imag});
+      if (Builder.GetInsertPoint()->comesBefore(InsertPoint))
+        Builder.SetInsertPoint(InsertPoint);
----------------
danilaml wrote:
> Not sure if it's the good/proper place to fix it, but at least it ensures that callers of `replaceNode` will insert their instructions after it.
It's a good idea, but unfortunately, this won't work out because `Builder.GetInsertPoint()` might be from a different block than `InsertPoint`. I added a review with a fix - https://reviews.llvm.org/D159209


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159123



More information about the llvm-commits mailing list