[PATCH] D107262: [CodeGenPrepare] The instruction to be sunk should be inserted before its user in a block

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 12 09:17:37 PDT 2021


dmgreen accepted this revision.
dmgreen added a comment.
This revision is now accepted and ready to land.

Yeah, this sounds good to me. I might have used `std::distance(TargetBB->begin(), UI) < std::distance(TargetBB->begin(), InsertPt)` myself, as there will only even be a few sinking nodes and they may not be in the TargetDB, but your way with collecting the block sounds good too.

LGTM



================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:6954
+  Instruction *InsertPoint = I;
+  DenseMap<const Instruction *, unsigned long> InstOrdering;
+  unsigned long InstNumber = 0;
----------------
I would either use uint32_t or uint64_t to be specific. I don't think there could be more than 2^32 instructions in a block.


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

https://reviews.llvm.org/D107262



More information about the llvm-commits mailing list