[PATCH] D43822: [CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 11:06:00 PST 2018


junbuml added inline comments.


================
Comment at: lib/Transforms/Utils/CloneFunction.cpp:816
+  // terminator gets replaced and StopAt == BB's terminator.
+  for (; StopAt != &*BI && BB->getTerminator() != &*BI; ++BI) {
     Instruction *New = BI->clone();
----------------
Since StopAt is Instruction*, this function cannot clone the terminator itself. We can clone up to one instruction before the terminator. Curious if this is what this function was initially intended.  


https://reviews.llvm.org/D43822





More information about the llvm-commits mailing list