[PATCH] D129660: [IR] Add Instruction::getInsertionPointAfterDef()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 07:39:05 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:2641
+      InsertPt = &*F->getEntryBlock().begin();
+    if (InsertPt)
+      DVI->moveBefore(InsertPt);
----------------
reames wrote:
> I think you should assert InsertPt here.  Otherwise, we have to figure out what to do with DVI in the catch switch case which the existing code didn't handle.  
I believe this code just performs the move for cosmetic reasons (dbg.declare is not control dependent, it does not matter where in the function it occurs) -- so I think just doing nothing if no insertion point is found would be the right thing to do here (though I have no idea whether this can occur in practice in the context where this function is used).


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

https://reviews.llvm.org/D129660



More information about the llvm-commits mailing list