[PATCH] D83379: [Coroutines] Refactor sinkLifetimeStartMarkers

JunMa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 19:31:52 PDT 2020


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


================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1578
+      auto isUsedByLifetimeStart = [&](Instruction *I) {
+        if (isa<BitCastInst>(I) && I->hasOneUse())
+          if (auto *IT = dyn_cast<IntrinsicInst>(I->user_back()))
----------------
lxfind wrote:
> If I is a BitCastInst, wouldn't it be used by both lifetime.start and lifetime.end intrinsics, and hence has more than one user?
Since sinkLifetimeStartMarkers  is called after rewriteMaterializableInstructions, so if BitCastInst both used by lifetime.start and lifetime.end, then I should not cross the suspend point. So I believe that we can use hasOneUse here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83379





More information about the llvm-commits mailing list